aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-05-18 13:54:54 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-05-18 13:54:54 -0400
commite51066824af49c2b1e9e686ee9660f58641c7f36 (patch)
tree17f0e251aaafef1929b7cb19c27c81133e1f5f16 /sound/soc
parentff9129b06cfb05cb5920f1151c75506afe1586fe (diff)
parent12716cd44da7e6c935e2fb1783417ca31fbbaa97 (diff)
Merge branch 'devm_no_resource_check' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux
Pull devm usage cleanup from Wolfram Sang: "Lately, I have been experimenting how to improve the devm interface to make writing device drivers easier and less error prone while also getting rid of its subtle issues. I think it has more potential but still needs work and definately conistency, especiall in its usage. The first thing I come up with is a low hanging fruit regarding devm_ioremap_resouce(). This function already checks if the passed resource is valid and gives an error message if not. So, we can remove similar checks from the drivers and get rid of a bit of code and a number of inconsistent error strings. This series only removes the unneeded check iff devm_ioremap_resource follows platform_get_resource directly. The previous version tried to shuffle code if needed, too, what lead to an embarrasing bug. It turned out to me that shuffling code for all cases found will make the automated script too complex, so I am unsure if an automated cleanup is the proper tool for this case. Removing the easy stuff seems worthwhile to me, though. Despite various architectures and platform dependencies, I managed to compile test 45 out of 57 modified files locally using heuristics and defconfigs." Pulled because: 296 deletions, 0 additions. * 'devm_no_resource_check' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: (33 commits) sound/soc/kirkwood: don't check resource with devm_ioremap_resource sound/soc/fsl: don't check resource with devm_ioremap_resource arch/mips/lantiq/xway: don't check resource with devm_ioremap_resource arch/arm/plat-samsung: don't check resource with devm_ioremap_resource arch/arm/mach-tegra: don't check resource with devm_ioremap_resource drivers/watchdog: don't check resource with devm_ioremap_resource drivers/w1/masters: don't check resource with devm_ioremap_resource drivers/video/omap2/dss: don't check resource with devm_ioremap_resource drivers/video/omap2: don't check resource with devm_ioremap_resource drivers/usb/phy: don't check resource with devm_ioremap_resource drivers/usb/host: don't check resource with devm_ioremap_resource drivers/usb/gadget: don't check resource with devm_ioremap_resource drivers/usb/chipidea: don't check resource with devm_ioremap_resource drivers/thermal: don't check resource with devm_ioremap_resource drivers/staging/nvec: don't check resource with devm_ioremap_resource drivers/staging/dwc2: don't check resource with devm_ioremap_resource drivers/spi: don't check resource with devm_ioremap_resource drivers/rtc: don't check resource with devm_ioremap_resource drivers/pwm: don't check resource with devm_ioremap_resource drivers/pinctrl: don't check resource with devm_ioremap_resource ...
Diffstat (limited to 'sound/soc')
-rw-r--r--sound/soc/fsl/imx-ssi.c6
-rw-r--r--sound/soc/kirkwood/kirkwood-i2s.c5
2 files changed, 0 insertions, 11 deletions
diff --git a/sound/soc/fsl/imx-ssi.c b/sound/soc/fsl/imx-ssi.c
index 902fab02b851..c6fa03e2114a 100644
--- a/sound/soc/fsl/imx-ssi.c
+++ b/sound/soc/fsl/imx-ssi.c
@@ -540,11 +540,6 @@ static int imx_ssi_probe(struct platform_device *pdev)
540 clk_prepare_enable(ssi->clk); 540 clk_prepare_enable(ssi->clk);
541 541
542 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 542 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
543 if (!res) {
544 ret = -ENODEV;
545 goto failed_get_resource;
546 }
547
548 ssi->base = devm_ioremap_resource(&pdev->dev, res); 543 ssi->base = devm_ioremap_resource(&pdev->dev, res);
549 if (IS_ERR(ssi->base)) { 544 if (IS_ERR(ssi->base)) {
550 ret = PTR_ERR(ssi->base); 545 ret = PTR_ERR(ssi->base);
@@ -633,7 +628,6 @@ failed_pdev_fiq_alloc:
633 snd_soc_unregister_component(&pdev->dev); 628 snd_soc_unregister_component(&pdev->dev);
634failed_register: 629failed_register:
635 release_mem_region(res->start, resource_size(res)); 630 release_mem_region(res->start, resource_size(res));
636failed_get_resource:
637 clk_disable_unprepare(ssi->clk); 631 clk_disable_unprepare(ssi->clk);
638failed_clk: 632failed_clk:
639 633
diff --git a/sound/soc/kirkwood/kirkwood-i2s.c b/sound/soc/kirkwood/kirkwood-i2s.c
index befe68f59285..4c9dad3263c5 100644
--- a/sound/soc/kirkwood/kirkwood-i2s.c
+++ b/sound/soc/kirkwood/kirkwood-i2s.c
@@ -471,11 +471,6 @@ static int kirkwood_i2s_dev_probe(struct platform_device *pdev)
471 dev_set_drvdata(&pdev->dev, priv); 471 dev_set_drvdata(&pdev->dev, priv);
472 472
473 mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); 473 mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
474 if (!mem) {
475 dev_err(&pdev->dev, "platform_get_resource failed\n");
476 return -ENXIO;
477 }
478
479 priv->io = devm_ioremap_resource(&pdev->dev, mem); 474 priv->io = devm_ioremap_resource(&pdev->dev, mem);
480 if (IS_ERR(priv->io)) 475 if (IS_ERR(priv->io))
481 return PTR_ERR(priv->io); 476 return PTR_ERR(priv->io);