Skip to contentSkip to conversation

ata: pata_imx: fix devm_ioremap_resource() return value checking

PATCH Applied Bartlomiej Zolnierkiewicz 2 participants 2 messages Mar 14, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
Compile tested only.

 drivers/ata/pata_imx.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/ata/pata_imx.c +2 -2
Index: b/drivers/ata/pata_imx.c
===================================================================
@@ -133,8 +133,8 @@ static int pata_imx_probe(struct platfor
 
 	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;
 	}
 
Applied
#1 lore raw
Quoted 5 lines · Bartlomiej Zolnierkiewicz

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.

Applied to libata/for-3.15.

Thanks.

Signature · 1 line
tejun