* [PATCH -next] clocksource/drivers/ingenic_ost: Fix return value check in ingenic_ost_probe()
@ 2021-03-08 12:30 'Wei Yongjun
2021-04-09 10:27 ` [tip: timers/core] " tip-bot2 for Wei Yongjun
0 siblings, 1 reply; 2+ messages in thread
From: 'Wei Yongjun @ 2021-03-08 12:30 UTC (permalink / raw)
To: weiyongjun1, Daniel Lezcano, Thomas Gleixner, Maarten ter Huurne
Cc: linux-kernel, kernel-janitors, Hulk Robot
From: Wei Yongjun <weiyongjun1@huawei.com>
In case of error, the function device_node_to_regmap() returns
ERR_PTR() and never returns NULL. The NULL test in the return
value check should be replaced with IS_ERR().
Fixes: ca7b72b5a5f2 ("clocksource: Add driver for the Ingenic JZ47xx OST")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
drivers/clocksource/ingenic-ost.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/clocksource/ingenic-ost.c b/drivers/clocksource/ingenic-ost.c
index 029efc2731b4..6af2470136bd 100644
--- a/drivers/clocksource/ingenic-ost.c
+++ b/drivers/clocksource/ingenic-ost.c
@@ -88,9 +88,9 @@ static int __init ingenic_ost_probe(struct platform_device *pdev)
return PTR_ERR(ost->regs);
map = device_node_to_regmap(dev->parent->of_node);
- if (!map) {
+ if (IS_ERR(map)) {
dev_err(dev, "regmap not found");
- return -EINVAL;
+ return PTR_ERR(map);
}
ost->clk = devm_clk_get(dev, "ost");
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [tip: timers/core] clocksource/drivers/ingenic_ost: Fix return value check in ingenic_ost_probe()
2021-03-08 12:30 [PATCH -next] clocksource/drivers/ingenic_ost: Fix return value check in ingenic_ost_probe() 'Wei Yongjun
@ 2021-04-09 10:27 ` tip-bot2 for Wei Yongjun
0 siblings, 0 replies; 2+ messages in thread
From: tip-bot2 for Wei Yongjun @ 2021-04-09 10:27 UTC (permalink / raw)
To: linux-tip-commits
Cc: Hulk Robot, Wei Yongjun, Daniel Lezcano, x86, linux-kernel
The following commit has been merged into the timers/core branch of tip:
Commit-ID: 2a65f7e2772613debd03fa2492e76a635aa04545
Gitweb: https://git.kernel.org/tip/2a65f7e2772613debd03fa2492e76a635aa04545
Author: Wei Yongjun <weiyongjun1@huawei.com>
AuthorDate: Mon, 08 Mar 2021 12:30:31
Committer: Daniel Lezcano <daniel.lezcano@linaro.org>
CommitterDate: Thu, 08 Apr 2021 13:24:15 +02:00
clocksource/drivers/ingenic_ost: Fix return value check in ingenic_ost_probe()
In case of error, the function device_node_to_regmap() returns
ERR_PTR() and never returns NULL. The NULL test in the return
value check should be replaced with IS_ERR().
Fixes: ca7b72b5a5f2 ("clocksource: Add driver for the Ingenic JZ47xx OST")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20210308123031.2285083-1-weiyongjun1@huawei.com
---
drivers/clocksource/ingenic-ost.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/clocksource/ingenic-ost.c b/drivers/clocksource/ingenic-ost.c
index d2d6646..06d2575 100644
--- a/drivers/clocksource/ingenic-ost.c
+++ b/drivers/clocksource/ingenic-ost.c
@@ -88,9 +88,9 @@ static int __init ingenic_ost_probe(struct platform_device *pdev)
return PTR_ERR(ost->regs);
map = device_node_to_regmap(dev->parent->of_node);
- if (!map) {
+ if (IS_ERR(map)) {
dev_err(dev, "regmap not found");
- return -EINVAL;
+ return PTR_ERR(map);
}
ost->clk = devm_clk_get(dev, "ost");
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-04-09 10:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-08 12:30 [PATCH -next] clocksource/drivers/ingenic_ost: Fix return value check in ingenic_ost_probe() 'Wei Yongjun
2021-04-09 10:27 ` [tip: timers/core] " tip-bot2 for Wei Yongjun
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).