From c430cf376fee0b03d9c9293615f9737649de1b12 Mon Sep 17 00:00:00 2001 From: Amitoj Kaur Chawla Date: Thu, 5 May 2016 17:50:49 +0530 Subject: mailbox: Fix devm_ioremap_resource error detection code devm_ioremap_resource returns an ERR_PTR value, not NULL, on failure. The Coccinelle semantic patch used to make this change is as follows: @@ expression e,e1; statement S; @@ *e = devm_ioremap_resource(...); if (!e1) S Signed-off-by: Amitoj Kaur Chawla Signed-off-by: Jassi Brar --- drivers/mailbox/mailbox-sti.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/mailbox') diff --git a/drivers/mailbox/mailbox-sti.c b/drivers/mailbox/mailbox-sti.c index 2394cfe892b6..a334db5c9f1c 100644 --- a/drivers/mailbox/mailbox-sti.c +++ b/drivers/mailbox/mailbox-sti.c @@ -430,8 +430,8 @@ static int sti_mbox_probe(struct platform_device *pdev) res = platform_get_resource(pdev, IORESOURCE_MEM, 0); mdev->base = devm_ioremap_resource(&pdev->dev, res); - if (!mdev->base) - return -ENOMEM; + if (IS_ERR(mdev->base)) + return PTR_ERR(mdev->base); ret = of_property_read_string(np, "mbox-name", &mdev->name); if (ret) -- cgit v1.2.3