ata: palmld: fix return value check in palmld_pata_probe()
PATCH RESEND 1/1 ata: palmld: fix return value check in palmld_pata_probe()
If devm_platform_ioremap_resource() fails, it never return NULL pointer, replace the check with IS_ERR().
---
The previous patch link:
https://lore.kernel.org/lkml/[email protected]/T/#t
--- drivers/ata/pata_palmld.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/ata/pata_palmld.c +2 -2
@@ -63,8 +63,8 @@ static int palmld_pata_probe(struct platform_device *pdev)/* remap drive's physical memory address */ mem =devm_platform_ioremap_resource (pdev,0 ); -if (!mem) -return -ENOMEM ; +if (IS_ERR (mem)) +return PTR_ERR (mem);/* request and activate power and reset GPIOs */ lda->power =devm_gpiod_get (dev,"power" ,GPIOD_OUT_HIGH );
Signature · 1 line
2.25.1
Quoted 19 lines · Yang Yingliang
If
devm_platform_ioremap_resource()fails, it never return NULL pointer, replace the check withIS_ERR().Fixes 57bf0f5a162d ("ARM: pxa: use pdev resource for palmld mmio")Signed-off-by Yang Yingliang <[email protected]>Reviewed-by Sergey Shtylyov <[email protected]>Acked-by Damien Le Moal <[email protected]>---
The previous patch link:
https://lore.kernel.org/lkml/[email protected]/T/#t--- drivers/ata/pata_palmld.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/ata/pata_palmld.c +0
-0
drivers/ata/pata_palmld.c static int palmld_pata_probe(struct platform_device *pdev) · line 70
Quoted 10 lines
drivers/ata/pata_palmld.c +2
-2@@ -63,8 +63,8 @@ static int palmld_pata_probe(struct platform_device *pdev)/* remap drive's physical memory address */ mem =devm_platform_ioremap_resource (pdev,0 ); -if (!mem) -return -ENOMEM ; +if (IS_ERR (mem)) +return PTR_ERR (mem);/* request and activate power and reset GPIOs */ lda->power =devm_gpiod_get (dev,"power" ,GPIOD_OUT_HIGH );
Arnd has a series of patches that removes this driver from the kernel in 6.2. Do you need this fix for a stable release ?
Signature · 2 lines
Damien Le Moal Western Digital Research
Hi,
Quoted 28 lines · Damien Le Moal
Quoted 27 lines · Yang Yingliang
If
devm_platform_ioremap_resource()fails, it never return NULL pointer, replace the check withIS_ERR().Fixes 57bf0f5a162d ("ARM: pxa: use pdev resource for palmld mmio")Signed-off-by Yang Yingliang <[email protected]>Reviewed-by Sergey Shtylyov <[email protected]>Acked-by Damien Le Moal <[email protected]>---
The previous patch link:
https://lore.kernel.org/lkml/[email protected]/T/#t--- drivers/ata/pata_palmld.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/ata/pata_palmld.c +2
-2@@ -63,8 +63,8 @@ static int palmld_pata_probe(struct platform_device *pdev)/* remap drive's physical memory address */ mem =devm_platform_ioremap_resource (pdev,0 ); -if (!mem) -return -ENOMEM ; +if (IS_ERR (mem)) +return PTR_ERR (mem);
Quoted 4 lines
drivers/ata/pata_palmld.c static int palmld_pata_probe(struct platform_device *pdev) · line 70
Quoted 2 lines
drivers/ata/pata_palmld.c +0
-0/* request and activate power and reset GPIOs */ lda->power =devm_gpiod_get (dev,"power" ,GPIOD_OUT_HIGH );Arnd has a series of patches that removes this driver from the kernel in 6.2. Do you need this fix for a stable release ?
It's nice that you can merge this patch. If you don't take this, it's not a big problem.
Thanks,
Yang
Quoted 1 line
Quoted 34 lines · Yang Yingliang
Hi,
Quoted 15 lines · Damien Le Moal
Quoted 14 lines · Yang Yingliang
If
devm_platform_ioremap_resource()fails, it never return NULL pointer, replace the check withIS_ERR().Fixes 57bf0f5a162d ("ARM: pxa: use pdev resource for palmld mmio")Signed-off-by Yang Yingliang <[email protected]>Reviewed-by Sergey Shtylyov <[email protected]>Acked-by Damien Le Moal <[email protected]>---
The previous patch link:
https://lore.kernel.org/lkml/[email protected]/T/#t
---
drivers/ata/pata_palmld.c| 4 ++--1 file changed, 2 insertions(+), 2 deletions(-)Quoted 16 lines
Quoted 5 lines
drivers/ata/pata_palmld.c +0
-0drivers/ata/pata_palmld.c static int palmld_pata_probe(struct platform_device · line 69
Quoted 9 lines
drivers/ata/pata_palmld.c +2
-2@@ -63,8 +63,8 @@ static int palmld_pata_probe(struct platform_device *pdev) /* remap drive's physical memory address */ mem = devm_platform_ioremap_resource(pdev, 0); - if (!mem) - return -ENOMEM; + if (IS_ERR(mem)) + return PTR_ERR(mem); /* request and activate power and reset GPIOs */ lda->power = devm_gpiod_get(dev, "power", GPIOD_OUT_HIGH);Arnd has a series of patches that removes this driver from the kernel in 6.2. Do you need this fix for a stable release ?
Quoted 2 lines
It's nice that you can merge this patch. If you don't take this, it's not a big problem.
Sorry, I got confused. This is a bug fix, so I will apply it to for-6.1-fixes. I was thinking about 6.2, but the driver will then be gone.
Quoted 4 lines
Thanks,
YangQuoted 1 line
Signature · 2 lines
Damien Le Moal Western Digital Research
Damien Le Moal
AppliedQuoted 7 lines · Yang Yingliang
If
devm_platform_ioremap_resource()fails, it never return NULL pointer, replace the check withIS_ERR().Fixes 57bf0f5a162d ("ARM: pxa: use pdev resource for palmld mmio")Signed-off-by Yang Yingliang <[email protected]>Reviewed-by Sergey Shtylyov <[email protected]>Acked-by Damien Le Moal <[email protected]>
Applied to for-6.1-fixes. Thanks !
Quoted 22 lines
---
The previous patch link:
https://lore.kernel.org/lkml/[email protected]/T/#t--- drivers/ata/pata_palmld.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/ata/pata_palmld.c +2
-2@@ -63,8 +63,8 @@ static int palmld_pata_probe(struct platform_device *pdev)/* remap drive's physical memory address */ mem =devm_platform_ioremap_resource (pdev,0 ); -if (!mem) -return -ENOMEM ; +if (IS_ERR (mem)) +return PTR_ERR (mem);/* request and activate power and reset GPIOs */ lda->power =devm_gpiod_get (dev,"power" ,GPIOD_OUT_HIGH );
Signature · 2 lines
Damien Le Moal Western Digital Research