diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2013-05-08 05:47:38 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2013-05-12 14:03:12 -0400 |
commit | bfcc74e6101a978b3987e767815595e5a9fec2ca (patch) | |
tree | eb7f22bab0edcd1344252c1d6cb848735bbd731b | |
parent | 52c102e534fd46a25aacab37bbaaa593929a2ca1 (diff) |
ASoC: SPEAr spdif_{in,out}: use devm for clk and a few more cleanups
Drop dev_set_drvdata as this is handled in the core and use
devm_request_and_ioremap instead of devm_ioremap to properly register the
address range used
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-rw-r--r-- | sound/soc/spear/spdif_in.c | 7 | ||||
-rw-r--r-- | sound/soc/spear/spdif_out.c | 7 |
2 files changed, 3 insertions, 11 deletions
diff --git a/sound/soc/spear/spdif_in.c b/sound/soc/spear/spdif_in.c index 82c838753c06..643ada6a1fa5 100644 --- a/sound/soc/spear/spdif_in.c +++ b/sound/soc/spear/spdif_in.c | |||
@@ -231,7 +231,7 @@ static int spdif_in_probe(struct platform_device *pdev) | |||
231 | if (host->irq < 0) | 231 | if (host->irq < 0) |
232 | return -EINVAL; | 232 | return -EINVAL; |
233 | 233 | ||
234 | host->clk = clk_get(&pdev->dev, NULL); | 234 | host->clk = devm_clk_get(&pdev->dev, NULL); |
235 | if (IS_ERR(host->clk)) | 235 | if (IS_ERR(host->clk)) |
236 | return PTR_ERR(host->clk); | 236 | return PTR_ERR(host->clk); |
237 | 237 | ||
@@ -253,7 +253,6 @@ static int spdif_in_probe(struct platform_device *pdev) | |||
253 | ret = devm_request_irq(&pdev->dev, host->irq, spdif_in_irq, 0, | 253 | ret = devm_request_irq(&pdev->dev, host->irq, spdif_in_irq, 0, |
254 | "spdif-in", host); | 254 | "spdif-in", host); |
255 | if (ret) { | 255 | if (ret) { |
256 | clk_put(host->clk); | ||
257 | dev_warn(&pdev->dev, "request_irq failed\n"); | 256 | dev_warn(&pdev->dev, "request_irq failed\n"); |
258 | return ret; | 257 | return ret; |
259 | } | 258 | } |
@@ -273,14 +272,10 @@ static int spdif_in_remove(struct platform_device *pdev) | |||
273 | struct spdif_in_dev *host = dev_get_drvdata(&pdev->dev); | 272 | struct spdif_in_dev *host = dev_get_drvdata(&pdev->dev); |
274 | 273 | ||
275 | snd_soc_unregister_component(&pdev->dev); | 274 | snd_soc_unregister_component(&pdev->dev); |
276 | dev_set_drvdata(&pdev->dev, NULL); | ||
277 | |||
278 | clk_put(host->clk); | ||
279 | 275 | ||
280 | return 0; | 276 | return 0; |
281 | } | 277 | } |
282 | 278 | ||
283 | |||
284 | static struct platform_driver spdif_in_driver = { | 279 | static struct platform_driver spdif_in_driver = { |
285 | .probe = spdif_in_probe, | 280 | .probe = spdif_in_probe, |
286 | .remove = spdif_in_remove, | 281 | .remove = spdif_in_remove, |
diff --git a/sound/soc/spear/spdif_out.c b/sound/soc/spear/spdif_out.c index 12b4f2fcb9af..fd25cc5efe27 100644 --- a/sound/soc/spear/spdif_out.c +++ b/sound/soc/spear/spdif_out.c | |||
@@ -298,14 +298,14 @@ static int spdif_out_probe(struct platform_device *pdev) | |||
298 | return -ENOMEM; | 298 | return -ENOMEM; |
299 | } | 299 | } |
300 | 300 | ||
301 | host->io_base = devm_ioremap(&pdev->dev, res->start, | 301 | host->io_base = devm_request_and_ioremap(&pdev->dev, res->start, |
302 | resource_size(res)); | 302 | resource_size(res)); |
303 | if (!host->io_base) { | 303 | if (!host->io_base) { |
304 | dev_warn(&pdev->dev, "ioremap failed\n"); | 304 | dev_warn(&pdev->dev, "ioremap failed\n"); |
305 | return -ENOMEM; | 305 | return -ENOMEM; |
306 | } | 306 | } |
307 | 307 | ||
308 | host->clk = clk_get(&pdev->dev, NULL); | 308 | host->clk = devm_clk_get(&pdev->dev, NULL); |
309 | if (IS_ERR(host->clk)) | 309 | if (IS_ERR(host->clk)) |
310 | return PTR_ERR(host->clk); | 310 | return PTR_ERR(host->clk); |
311 | 311 | ||
@@ -334,9 +334,6 @@ static int spdif_out_remove(struct platform_device *pdev) | |||
334 | struct spdif_out_dev *host = dev_get_drvdata(&pdev->dev); | 334 | struct spdif_out_dev *host = dev_get_drvdata(&pdev->dev); |
335 | 335 | ||
336 | snd_soc_unregister_component(&pdev->dev); | 336 | snd_soc_unregister_component(&pdev->dev); |
337 | dev_set_drvdata(&pdev->dev, NULL); | ||
338 | |||
339 | clk_put(host->clk); | ||
340 | 337 | ||
341 | return 0; | 338 | return 0; |
342 | } | 339 | } |