diff options
author | Yang Yingliang <[email protected]> | 2022-10-29 15:49:31 +0800 |
---|---|---|
committer | Damien Le Moal <[email protected]> | 2022-10-31 20:28:05 +0900 |
commit | 015618c3ec19584c83ff179fa631be8cec906aaf (patch) | |
tree | 9760b63ccc3a3aba4da3c363a1b951f8d834469c | |
parent | 171a93182eccd6e6835d2c86b40787f9f832efaa (diff) |
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().
Fixes: 57bf0f5a162d ("ARM: pxa: use pdev resource for palmld mmio")
Signed-off-by: Yang Yingliang <[email protected]>
Reviewed-by: Sergey Shtylyov <[email protected]>
Signed-off-by: Damien Le Moal <[email protected]>
-rw-r--r-- | drivers/ata/pata_palmld.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/ata/pata_palmld.c b/drivers/ata/pata_palmld.c index 400e65190904..51caa2a427dd 100644 --- a/drivers/ata/pata_palmld.c +++ b/drivers/ata/pata_palmld.c @@ -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); |