mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 17:25:35 +03:00
ASoC: tegra: s/IS_ERR_OR_NULL/IS_ERR/ for clk_get_sys
A recent discussion on linux-arm-kernel noted that the value returned by clk_get_sys is an opaque token, and not strictly a pointer; it is meaningful only to the clock API, clients should not dereference the value, and the clock API must accept any non-IS_ERR value it returned. Hence, only IS_ERR is appropriate to interpret the result, not IS_ERR_OR_NULL. I checked that clk_get_sys in both ASoC's for-next and Tegra's for-next do behave as described; NULL is not returned in the case of error. Signed-off-by: Stephen Warren <swarren@nvidia.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This commit is contained in:
committed by
Sameer Pujar
parent
7a14f10e18
commit
46857a5e90
@@ -113,35 +113,33 @@ int tegra_asoc_utils_init(void)
|
|||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
clk_pll_a = clk_get_sys(NULL, "pll_a");
|
clk_pll_a = clk_get_sys(NULL, "pll_a");
|
||||||
if (IS_ERR_OR_NULL(clk_pll_a)) {
|
if (IS_ERR(clk_pll_a)) {
|
||||||
pr_err(PREFIX "Can't retrieve clk pll_a\n");
|
pr_err(PREFIX "Can't retrieve clk pll_a\n");
|
||||||
ret = PTR_ERR(clk_pll_a);
|
ret = PTR_ERR(clk_pll_a);
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
clk_pll_a_out0 = clk_get_sys(NULL, "pll_a_out0");
|
clk_pll_a_out0 = clk_get_sys(NULL, "pll_a_out0");
|
||||||
if (IS_ERR_OR_NULL(clk_pll_a_out0)) {
|
if (IS_ERR(clk_pll_a_out0)) {
|
||||||
pr_err(PREFIX "Can't retrieve clk pll_a_out0\n");
|
pr_err(PREFIX "Can't retrieve clk pll_a_out0\n");
|
||||||
ret = PTR_ERR(clk_pll_a_out0);
|
ret = PTR_ERR(clk_pll_a_out0);
|
||||||
goto err;
|
goto err_put_pll_a;
|
||||||
}
|
}
|
||||||
|
|
||||||
clk_cdev1 = clk_get_sys(NULL, "cdev1");
|
clk_cdev1 = clk_get_sys(NULL, "cdev1");
|
||||||
if (IS_ERR_OR_NULL(clk_cdev1)) {
|
if (IS_ERR(clk_cdev1)) {
|
||||||
pr_err(PREFIX "Can't retrieve clk cdev1\n");
|
pr_err(PREFIX "Can't retrieve clk cdev1\n");
|
||||||
ret = PTR_ERR(clk_cdev1);
|
ret = PTR_ERR(clk_cdev1);
|
||||||
goto err;
|
goto err_put_pll_a_out0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
err:
|
err_put_pll_a_out0:
|
||||||
if (!IS_ERR_OR_NULL(clk_cdev1))
|
|
||||||
clk_put(clk_cdev1);
|
|
||||||
if (!IS_ERR_OR_NULL(clk_pll_a_out0))
|
|
||||||
clk_put(clk_pll_a_out0);
|
clk_put(clk_pll_a_out0);
|
||||||
if (!IS_ERR_OR_NULL(clk_pll_a))
|
err_put_pll_a:
|
||||||
clk_put(clk_pll_a);
|
clk_put(clk_pll_a);
|
||||||
|
err:
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user