From: Dan Carpenter <dan.carpenter@oracle.com>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
Subject: [PATCH] bus: arm-integrator-lm: Fix an IS_ERR() vs NULL check
Date: Wed, 20 May 2020 12:08:04 +0000 [thread overview]
Message-ID: <20200520120804.GI172354@mwanda> (raw)
The of_find_matching_node() function returns NULL on error, it never
returns error pointers. This doesn't really impact runtime very much
because if "syscon" is NULL then syscon_node_to_regmap() will return
-EINVAL. The only runtime difference is that now it returns -ENODEV.
Fixes: ccea5e8a5918 ("bus: Add driver for Integrator/AP logic modules")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
The first patch which added this file doesn't give a good hint what the
subsystem prefix should be so I just guessed "bus: arm-integrator-lm:".
drivers/bus/arm-integrator-lm.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/bus/arm-integrator-lm.c b/drivers/bus/arm-integrator-lm.c
index 669ea7e1f92e..845b6c43fef8 100644
--- a/drivers/bus/arm-integrator-lm.c
+++ b/drivers/bus/arm-integrator-lm.c
@@ -78,10 +78,10 @@ static int integrator_ap_lm_probe(struct platform_device *pdev)
/* Look up the system controller */
syscon = of_find_matching_node(NULL, integrator_ap_syscon_match);
- if (IS_ERR(syscon)) {
+ if (!syscon) {
dev_err(dev,
"could not find Integrator/AP system controller\n");
- return PTR_ERR(syscon);
+ return -ENODEV;
}
map = syscon_node_to_regmap(syscon);
if (IS_ERR(map)) {
--
2.26.2
next reply other threads:[~2020-05-20 12:08 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-20 12:08 Dan Carpenter [this message]
2020-05-25 9:18 ` [PATCH] bus: arm-integrator-lm: Fix an IS_ERR() vs NULL check Linus Walleij
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=20200520120804.GI172354@mwanda \
--to=dan.carpenter@oracle.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).