aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/sh/rcar/gen.c
diff options
context:
space:
mode:
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>2013-07-29 19:51:37 -0400
committerMark Brown <broonie@linaro.org>2013-07-31 10:00:01 -0400
commit70263cb474853c116f80713d468f3c17d805921c (patch)
treed92b3ea733464c520bf6d560f9e1b94096aabb95 /sound/soc/sh/rcar/gen.c
parentae5c322303fff50b93d60e34c6563f1264a5941b (diff)
ASoC: rcar: fix return value check in rsnd_gen1_probe()
In case of error, the function devm_ioremap_resource() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR(), and also remove the dev_err call to avoid redundant error message. Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'sound/soc/sh/rcar/gen.c')
-rw-r--r--sound/soc/sh/rcar/gen.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/sound/soc/sh/rcar/gen.c b/sound/soc/sh/rcar/gen.c
index 5e4ae0da4352..61232cd9908f 100644
--- a/sound/soc/sh/rcar/gen.c
+++ b/sound/soc/sh/rcar/gen.c
@@ -150,25 +150,16 @@ static int rsnd_gen1_probe(struct platform_device *pdev,
150 sru_res = platform_get_resource(pdev, IORESOURCE_MEM, RSND_GEN1_SRU); 150 sru_res = platform_get_resource(pdev, IORESOURCE_MEM, RSND_GEN1_SRU);
151 adg_res = platform_get_resource(pdev, IORESOURCE_MEM, RSND_GEN1_ADG); 151 adg_res = platform_get_resource(pdev, IORESOURCE_MEM, RSND_GEN1_ADG);
152 ssi_res = platform_get_resource(pdev, IORESOURCE_MEM, RSND_GEN1_SSI); 152 ssi_res = platform_get_resource(pdev, IORESOURCE_MEM, RSND_GEN1_SSI);
153 if (!sru_res ||
154 !adg_res ||
155 !ssi_res) {
156 dev_err(dev, "Not enough SRU/SSI/ADG platform resources.\n");
157 return -ENODEV;
158 }
159
160 gen->ops = &rsnd_gen1_ops;
161 153
162 gen->base[RSND_GEN1_SRU] = devm_ioremap_resource(dev, sru_res); 154 gen->base[RSND_GEN1_SRU] = devm_ioremap_resource(dev, sru_res);
163 gen->base[RSND_GEN1_ADG] = devm_ioremap_resource(dev, adg_res); 155 gen->base[RSND_GEN1_ADG] = devm_ioremap_resource(dev, adg_res);
164 gen->base[RSND_GEN1_SSI] = devm_ioremap_resource(dev, ssi_res); 156 gen->base[RSND_GEN1_SSI] = devm_ioremap_resource(dev, ssi_res);
165 if (!gen->base[RSND_GEN1_SRU] || 157 if (IS_ERR(gen->base[RSND_GEN1_SRU]) ||
166 !gen->base[RSND_GEN1_ADG] || 158 IS_ERR(gen->base[RSND_GEN1_ADG]) ||
167 !gen->base[RSND_GEN1_SSI]) { 159 IS_ERR(gen->base[RSND_GEN1_SSI]))
168 dev_err(dev, "SRU/SSI/ADG ioremap failed\n");
169 return -ENODEV; 160 return -ENODEV;
170 }
171 161
162 gen->ops = &rsnd_gen1_ops;
172 rsnd_gen1_reg_map_init(gen); 163 rsnd_gen1_reg_map_init(gen);
173 164
174 dev_dbg(dev, "Gen1 device probed\n"); 165 dev_dbg(dev, "Gen1 device probed\n");