diff options
author | Wei Yongjun <weiyongjun1@huawei.com> | 2021-03-08 13:30:31 +0100 |
---|---|---|
committer | Daniel Lezcano <daniel.lezcano@linaro.org> | 2021-04-08 13:24:15 +0200 |
commit | 2a65f7e2772613debd03fa2492e76a635aa04545 (patch) | |
tree | 1604e0c4df7ffe78b932b6ff89ebb862c79d608e /drivers/clocksource/ingenic-ost.c | |
parent | clocksource/drivers/timer-ti-dm: Add missing set_state_oneshot_stopped (diff) | |
download | linux-2a65f7e2772613debd03fa2492e76a635aa04545.tar.xz linux-2a65f7e2772613debd03fa2492e76a635aa04545.zip |
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
Diffstat (limited to 'drivers/clocksource/ingenic-ost.c')
-rw-r--r-- | drivers/clocksource/ingenic-ost.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/clocksource/ingenic-ost.c b/drivers/clocksource/ingenic-ost.c index d2d664601441..06d25754e606 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"); |