[patch] mailbox/xgene-slimpro: Checking for IS_ERR instead of NULL

From: Dan Carpenter
Date: Thu Feb 25 2016 - 16:32:54 EST


devm_ioremap() returns NULL, it never returns an ERR_PTR.

Fixes: f700e84f417b ('mailbox: Add support for APM X-Gene platform mailbox driver')
Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>

diff --git a/drivers/mailbox/mailbox-xgene-slimpro.c b/drivers/mailbox/mailbox-xgene-slimpro.c
index b5f5106..bd07f39 100644
--- a/drivers/mailbox/mailbox-xgene-slimpro.c
+++ b/drivers/mailbox/mailbox-xgene-slimpro.c
@@ -196,8 +196,8 @@ static int slimpro_mbox_probe(struct platform_device *pdev)

regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
mb_base = devm_ioremap(&pdev->dev, regs->start, resource_size(regs));
- if (IS_ERR(mb_base))
- return PTR_ERR(mb_base);
+ if (!mb_base)
+ return -ENOMEM;

/* Setup mailbox links */
for (i = 0; i < MBOX_CNT; i++) {