Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Wei Yongjun and committed by
Stephen Boyd
55c19eee 9903e41a

+2 -3
+2 -3
drivers/clk/qcom/apcs-msm8916.c
··· 49 49 struct clk_regmap_mux_div *a53cc; 50 50 struct regmap *regmap; 51 51 struct clk_init_data init = { }; 52 - int ret; 52 + int ret = -ENODEV; 53 53 54 54 regmap = dev_get_regmap(parent, NULL); 55 - if (IS_ERR(regmap)) { 56 - ret = PTR_ERR(regmap); 55 + if (!regmap) { 57 56 dev_err(dev, "failed to get regmap: %d\n", ret); 58 57 return ret; 59 58 }