summaryrefslogtreecommitdiffstats
path: root/drivers/clk
diff options
context:
space:
mode:
authorWei Yongjun <weiyongjun1@huawei.com>2018-01-04 07:34:43 +0100
committerStephen Boyd <sboyd@kernel.org>2018-03-12 23:14:24 +0100
commit55c19eee3b471e7ca7e38783836f7b7137c9d14f (patch)
tree51b0d70ded7d45bd6c401d74dc60b697fde98166 /drivers/clk
parentclk: hisilicon: hi3660:Fix potential NULL dereference in hi3660_stub_clk_pr... (diff)
downloadlinux-55c19eee3b471e7ca7e38783836f7b7137c9d14f.tar.xz
linux-55c19eee3b471e7ca7e38783836f7b7137c9d14f.zip
clk: qcom: msm8916: Fix return value check in qcom_apcs_msm8916_clk_probe()
In case of error, the function dev_get_regmap() returns NULL pointer not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test. Fixes: 81ac38847a1d ("clk: qcom: Add APCS clock controller support") Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Diffstat (limited to 'drivers/clk')
-rw-r--r--drivers/clk/qcom/apcs-msm8916.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/clk/qcom/apcs-msm8916.c b/drivers/clk/qcom/apcs-msm8916.c
index 246957f1a413..b1cc8dbcd327 100644
--- a/drivers/clk/qcom/apcs-msm8916.c
+++ b/drivers/clk/qcom/apcs-msm8916.c
@@ -49,11 +49,10 @@ static int qcom_apcs_msm8916_clk_probe(struct platform_device *pdev)
struct clk_regmap_mux_div *a53cc;
struct regmap *regmap;
struct clk_init_data init = { };
- int ret;
+ int ret = -ENODEV;
regmap = dev_get_regmap(parent, NULL);
- if (IS_ERR(regmap)) {
- ret = PTR_ERR(regmap);
+ if (!regmap) {
dev_err(dev, "failed to get regmap: %d\n", ret);
return ret;
}