ata: pata_imx: fix devm_ioremap_resource() return value checking
authorBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Fri, 14 Mar 2014 17:33:13 +0000 (18:33 +0100)
committerTejun Heo <tj@kernel.org>
Fri, 14 Mar 2014 18:30:28 +0000 (14:30 -0400)
devm_ioremap_resource() returns a pointer to the remapped memory or
an ERR_PTR() encoded error code on failure.  Fix the check inside
pata_imx_probe() accordingly.

Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
drivers/ata/pata_imx.c

index 121c748314c39480f0b1835a73a3431d6f5541a6..161769343ce7d46d37197792cb4f185f315e0c83 100644 (file)
@@ -131,8 +131,8 @@ static int pata_imx_probe(struct platform_device *pdev)
 
        io_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
        priv->host_regs = devm_ioremap_resource(&pdev->dev, io_res);
-       if (!priv->host_regs) {
-               ret = -EBUSY;
+       if (IS_ERR(priv->host_regs)) {
+               ret = PTR_ERR(priv->host_regs);
                goto err;
        }