From: Dan Carpenter <dan.carpenter@oracle.com>
To: Jassi Brar <jassisinghbrar@gmail.com>, Duc Dang <dhdang@apm.com>
Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [patch] mailbox/xgene-slimpro: Checking for IS_ERR instead of NULL
Date: Thu, 25 Feb 2016 21:32:21 +0000 [thread overview]
Message-ID: <20160225213221.GC18267@mwanda> (raw)
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@oracle.com>
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++) {
WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Jassi Brar <jassisinghbrar@gmail.com>, Duc Dang <dhdang@apm.com>
Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [patch] mailbox/xgene-slimpro: Checking for IS_ERR instead of NULL
Date: Fri, 26 Feb 2016 00:32:21 +0300 [thread overview]
Message-ID: <20160225213221.GC18267@mwanda> (raw)
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@oracle.com>
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++) {
next reply other threads:[~2016-02-25 21:32 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-25 21:32 Dan Carpenter [this message]
2016-02-25 21:32 ` [patch] mailbox/xgene-slimpro: Checking for IS_ERR instead of NULL Dan Carpenter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160225213221.GC18267@mwanda \
--to=dan.carpenter@oracle.com \
--cc=dhdang@apm.com \
--cc=jassisinghbrar@gmail.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.