From 14d653af4e32b1ae2964e5b2847ef6be191fee64 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Fri, 26 Feb 2016 00:32:21 +0300 Subject: [PATCH] mailbox/xgene-slimpro: Checking for IS_ERR instead of NULL 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 Signed-off-by: Jassi Brar --- drivers/mailbox/mailbox-xgene-slimpro.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/mailbox/mailbox-xgene-slimpro.c b/drivers/mailbox/mailbox-xgene-slimpro.c index b5f51062b1f7..bd07f39f0692 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++) { -- 2.20.1