Commit a5e9b85a authored by Wei Yongjun's avatar Wei Yongjun Committed by Stephen Boyd

clk: Fix return value check in oxnas_stdclk_probe()

In case of error, the function syscon_node_to_regmap() returns
ERR_PTR() and never returns NULL. The NULL test in the return
value check should be replaced with IS_ERR().
Signed-off-by: default avatarWei Yongjun <yongjun_wei@trendmicro.com.cn>
Acked-by: Neil Armstrong's avatarNeil Armstrong <narmstrong@baylibre.com>
Fixes: 0bbd72b4 ("clk: Add Oxford Semiconductor OXNAS Standard Clocks")
Signed-off-by: default avatarStephen Boyd <sboyd@codeaurora.org>
parent 72ad679a
...@@ -144,9 +144,9 @@ static int oxnas_stdclk_probe(struct platform_device *pdev) ...@@ -144,9 +144,9 @@ static int oxnas_stdclk_probe(struct platform_device *pdev)
return -ENOMEM; return -ENOMEM;
regmap = syscon_node_to_regmap(of_get_parent(np)); regmap = syscon_node_to_regmap(of_get_parent(np));
if (!regmap) { if (IS_ERR(regmap)) {
dev_err(&pdev->dev, "failed to have parent regmap\n"); dev_err(&pdev->dev, "failed to have parent regmap\n");
return -EINVAL; return PTR_ERR(regmap);
} }
for (i = 0; i < ARRAY_SIZE(clk_oxnas_init); i++) { for (i = 0; i < ARRAY_SIZE(clk_oxnas_init); i++) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment