diff options
author | Amitoj Kaur Chawla <amitoj1606@gmail.com> | 2016-05-05 08:20:49 -0400 |
---|---|---|
committer | Jassi Brar <jaswinder.singh@linaro.org> | 2016-05-08 13:14:46 -0400 |
commit | c430cf376fee0b03d9c9293615f9737649de1b12 (patch) | |
tree | 17f244075d59c9dbc9fd59d84df2a41abd5d1f8f | |
parent | dd28216528cf67339cd4f5854166fbd4eefd7fa8 (diff) |
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 <amitoj1606@gmail.com>
Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
-rw-r--r-- | drivers/mailbox/mailbox-sti.c | 4 |
1 files changed, 2 insertions, 2 deletions
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) | |||
430 | 430 | ||
431 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 431 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
432 | mdev->base = devm_ioremap_resource(&pdev->dev, res); | 432 | mdev->base = devm_ioremap_resource(&pdev->dev, res); |
433 | if (!mdev->base) | 433 | if (IS_ERR(mdev->base)) |
434 | return -ENOMEM; | 434 | return PTR_ERR(mdev->base); |
435 | 435 | ||
436 | ret = of_property_read_string(np, "mbox-name", &mdev->name); | 436 | ret = of_property_read_string(np, "mbox-name", &mdev->name); |
437 | if (ret) | 437 | if (ret) |