Skip to content

Commit

Permalink
clk: sprd: Use IS_ERR() to validate the return value of syscon_regmap…
Browse files Browse the repository at this point in the history
…_lookup_by_phandle()

The syscon_regmap_lookup_by_phandle() will never return NULL, thus use
IS_ERR() to validate the return value instead of IS_ERR_OR_NULL().

Fixes: d41f59f ("clk: sprd: Add common infrastructure")
Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
Link: https://lkml.kernel.org/r/1995139bee5248ff3e9d46dc715968f212cfc4cc.1570520268.git.baolin.wang@linaro.org
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
  • Loading branch information
wangbaolin719 authored and bebarino committed Nov 13, 2019
1 parent 54ecb8f commit 9629dbd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/clk/sprd/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ int sprd_clk_regmap_init(struct platform_device *pdev,

if (of_find_property(node, "sprd,syscon", NULL)) {
regmap = syscon_regmap_lookup_by_phandle(node, "sprd,syscon");
if (IS_ERR_OR_NULL(regmap)) {
if (IS_ERR(regmap)) {
pr_err("%s: failed to get syscon regmap\n", __func__);
return PTR_ERR(regmap);
}
Expand Down

0 comments on commit 9629dbd

Please sign in to comment.