From: Wei Yongjun <weiyongjun1@huawei.com>
To: Santosh Shilimkar <ssantosh@kernel.org>, Tero Kristo <t-kristo@ti.com>
Cc: Wei Yongjun <weiyongjun1@huawei.com>,
<linux-kernel@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
<kernel-janitors@vger.kernel.org>
Subject: [PATCH -next] soc: ti: omap-prm: fix return value check in omap_prm_probe()
Date: Fri, 11 Oct 2019 05:24:36 +0000 [thread overview]
Message-ID: <20191011052436.76075-1-weiyongjun1@huawei.com> (raw)
In case of error, the function devm_ioremap_resource() returns ERR_PTR()
and never returns NULL. The NULL test in the return value check should
be replaced with IS_ERR().
Fixes: 3e99cb214f03 ("soc: ti: add initial PRM driver with reset control support")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
drivers/soc/ti/omap_prm.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/soc/ti/omap_prm.c b/drivers/soc/ti/omap_prm.c
index db47a8bceb87..96c6f777519c 100644
--- a/drivers/soc/ti/omap_prm.c
+++ b/drivers/soc/ti/omap_prm.c
@@ -375,8 +375,8 @@ static int omap_prm_probe(struct platform_device *pdev)
prm->data = data;
prm->base = devm_ioremap_resource(&pdev->dev, res);
- if (!prm->base)
- return -ENOMEM;
+ if (IS_ERR(prm->base))
+ return PTR_ERR(prm->base);
return omap_prm_reset_init(pdev, prm);
}
next reply other threads:[~2019-10-11 5:25 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-11 5:24 Wei Yongjun [this message]
2019-10-29 17:59 ` [PATCH -next] soc: ti: omap-prm: fix return value check in omap_prm_probe() santosh.shilimkar
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=20191011052436.76075-1-weiyongjun1@huawei.com \
--to=weiyongjun1@huawei.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ssantosh@kernel.org \
--cc=t-kristo@ti.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox