aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/tegra
diff options
context:
space:
mode:
authorStephen Warren <swarren@nvidia.com>2011-01-11 14:48:53 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-01-13 09:18:03 -0500
commit422650e65a41a61b2f92396dfa4faa6a4df89913 (patch)
tree955c75a7badff9dfee6fec4a3134e844ca27012d /sound/soc/tegra
parent1500b7b5ffaacb8199e0a61162f5d349fb19acbe (diff)
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>
Diffstat (limited to 'sound/soc/tegra')
-rw-r--r--sound/soc/tegra/tegra_asoc_utils.c20
-rw-r--r--sound/soc/tegra/tegra_i2s.c2
2 files changed, 10 insertions, 12 deletions
diff --git a/sound/soc/tegra/tegra_asoc_utils.c b/sound/soc/tegra/tegra_asoc_utils.c
index 711ab7ff5ced..cfe2ea890dc0 100644
--- a/sound/soc/tegra/tegra_asoc_utils.c
+++ b/sound/soc/tegra/tegra_asoc_utils.c
@@ -113,35 +113,33 @@ int tegra_asoc_utils_init(void)
113 int ret; 113 int ret;
114 114
115 clk_pll_a = clk_get_sys(NULL, "pll_a"); 115 clk_pll_a = clk_get_sys(NULL, "pll_a");
116 if (IS_ERR_OR_NULL(clk_pll_a)) { 116 if (IS_ERR(clk_pll_a)) {
117 pr_err(PREFIX "Can't retrieve clk pll_a\n"); 117 pr_err(PREFIX "Can't retrieve clk pll_a\n");
118 ret = PTR_ERR(clk_pll_a); 118 ret = PTR_ERR(clk_pll_a);
119 goto err; 119 goto err;
120 } 120 }
121 121
122 clk_pll_a_out0 = clk_get_sys(NULL, "pll_a_out0"); 122 clk_pll_a_out0 = clk_get_sys(NULL, "pll_a_out0");
123 if (IS_ERR_OR_NULL(clk_pll_a_out0)) { 123 if (IS_ERR(clk_pll_a_out0)) {
124 pr_err(PREFIX "Can't retrieve clk pll_a_out0\n"); 124 pr_err(PREFIX "Can't retrieve clk pll_a_out0\n");
125 ret = PTR_ERR(clk_pll_a_out0); 125 ret = PTR_ERR(clk_pll_a_out0);
126 goto err; 126 goto err_put_pll_a;
127 } 127 }
128 128
129 clk_cdev1 = clk_get_sys(NULL, "cdev1"); 129 clk_cdev1 = clk_get_sys(NULL, "cdev1");
130 if (IS_ERR_OR_NULL(clk_cdev1)) { 130 if (IS_ERR(clk_cdev1)) {
131 pr_err(PREFIX "Can't retrieve clk cdev1\n"); 131 pr_err(PREFIX "Can't retrieve clk cdev1\n");
132 ret = PTR_ERR(clk_cdev1); 132 ret = PTR_ERR(clk_cdev1);
133 goto err; 133 goto err_put_pll_a_out0;
134 } 134 }
135 135
136 return 0; 136 return 0;
137 137
138err_put_pll_a_out0:
139 clk_put(clk_pll_a_out0);
140err_put_pll_a:
141 clk_put(clk_pll_a);
138err: 142err:
139 if (!IS_ERR_OR_NULL(clk_cdev1))
140 clk_put(clk_cdev1);
141 if (!IS_ERR_OR_NULL(clk_pll_a_out0))
142 clk_put(clk_pll_a_out0);
143 if (!IS_ERR_OR_NULL(clk_pll_a))
144 clk_put(clk_pll_a);
145 return ret; 143 return ret;
146} 144}
147 145
diff --git a/sound/soc/tegra/tegra_i2s.c b/sound/soc/tegra/tegra_i2s.c
index 1730509c8ac2..6d668785e9af 100644
--- a/sound/soc/tegra/tegra_i2s.c
+++ b/sound/soc/tegra/tegra_i2s.c
@@ -385,7 +385,7 @@ static __devinit int tegra_i2s_platform_probe(struct platform_device *pdev)
385 385
386 snprintf(clk_name, sizeof(clk_name), DRV_NAME ".%d", pdev->id); 386 snprintf(clk_name, sizeof(clk_name), DRV_NAME ".%d", pdev->id);
387 i2s->clk_i2s = clk_get_sys(clk_name, NULL); 387 i2s->clk_i2s = clk_get_sys(clk_name, NULL);
388 if (IS_ERR_OR_NULL(i2s->clk_i2s)) { 388 if (IS_ERR(i2s->clk_i2s)) {
389 pr_err("Can't retrieve i2s clock\n"); 389 pr_err("Can't retrieve i2s clock\n");
390 ret = PTR_ERR(i2s->clk_i2s); 390 ret = PTR_ERR(i2s->clk_i2s);
391 goto err_free; 391 goto err_free;