From: Bartlomiej Zolnierkiewicz Date: Fri, 14 Mar 2014 17:33:13 +0000 (+0100) Subject: ata: pata_imx: fix devm_ioremap_resource() return value checking X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=13e8e78bdd148f615da1e5d1edcf0b58b7c2b684;p=openwrt%2Fstaging%2Fblogic.git ata: pata_imx: fix devm_ioremap_resource() return value checking 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 Signed-off-by: Tejun Heo --- diff --git a/drivers/ata/pata_imx.c b/drivers/ata/pata_imx.c index 121c748314c3..161769343ce7 100644 --- a/drivers/ata/pata_imx.c +++ b/drivers/ata/pata_imx.c @@ -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; }