Commit 015618c3 authored by Yang Yingliang's avatar Yang Yingliang Committed by Damien Le Moal

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: 57bf0f5a ("ARM: pxa: use pdev resource for palmld mmio")
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
Reviewed-by: default avatarSergey Shtylyov <s.shtylyov@omp.ru>
Signed-off-by: default avatarDamien Le Moal <damien.lemoal@opensource.wdc.com>
parent 171a9318
...@@ -63,8 +63,8 @@ static int palmld_pata_probe(struct platform_device *pdev) ...@@ -63,8 +63,8 @@ static int palmld_pata_probe(struct platform_device *pdev)
/* remap drive's physical memory address */ /* remap drive's physical memory address */
mem = devm_platform_ioremap_resource(pdev, 0); mem = devm_platform_ioremap_resource(pdev, 0);
if (!mem) if (IS_ERR(mem))
return -ENOMEM; return PTR_ERR(mem);
/* request and activate power and reset GPIOs */ /* request and activate power and reset GPIOs */
lda->power = devm_gpiod_get(dev, "power", GPIOD_OUT_HIGH); lda->power = devm_gpiod_get(dev, "power", GPIOD_OUT_HIGH);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment