Skip to content

Commit

Permalink
clk: Fix return value check in oxnas_stdclk_probe()
Browse files Browse the repository at this point in the history
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: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Acked-by: Neil Armstrong <narmstrong@baylibre.com>
Fixes: 0bbd72b ("clk: Add Oxford Semiconductor OXNAS Standard Clocks")
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
  • Loading branch information
Wei Yongjun authored and Stephen Boyd committed Jun 21, 2016
1 parent 72ad679 commit a5e9b85
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/clk/clk-oxnas.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,9 @@ static int oxnas_stdclk_probe(struct platform_device *pdev)
return -ENOMEM;

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");
return -EINVAL;
return PTR_ERR(regmap);
}

for (i = 0; i < ARRAY_SIZE(clk_oxnas_init); i++) {
Expand Down

0 comments on commit a5e9b85

Please sign in to comment.