summaryrefslogtreecommitdiff
path: root/drivers/clk/clk-oxnas.c
diff options
context:
space:
mode:
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>2016-06-17 20:24:23 +0300
committerStephen Boyd <sboyd@codeaurora.org>2016-06-21 03:00:29 +0300
commita5e9b85a6540df6c4074d3a56674f6fb6c5fc830 (patch)
treede91389060c9e94e25e4a4f0331d550841dd90db /drivers/clk/clk-oxnas.c
parent72ad679aa7182d23d269cbe4d655f7e129d3b057 (diff)
downloadlinux-a5e9b85a6540df6c4074d3a56674f6fb6c5fc830.tar.xz
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: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Acked-by: Neil Armstrong <narmstrong@baylibre.com> Fixes: 0bbd72b4c64f ("clk: Add Oxford Semiconductor OXNAS Standard Clocks") Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Diffstat (limited to 'drivers/clk/clk-oxnas.c')
-rw-r--r--drivers/clk/clk-oxnas.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/clk/clk-oxnas.c b/drivers/clk/clk-oxnas.c
index efba7d4dbcfc..79bcb2e42060 100644
--- a/drivers/clk/clk-oxnas.c
+++ b/drivers/clk/clk-oxnas.c
@@ -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++) {