diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-05-18 13:54:54 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-05-18 13:54:54 -0400 |
commit | e51066824af49c2b1e9e686ee9660f58641c7f36 (patch) | |
tree | 17f0e251aaafef1929b7cb19c27c81133e1f5f16 /arch/arm | |
parent | ff9129b06cfb05cb5920f1151c75506afe1586fe (diff) | |
parent | 12716cd44da7e6c935e2fb1783417ca31fbbaa97 (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 'arch/arm')
-rw-r--r-- | arch/arm/mach-tegra/tegra2_emc.c | 5 | ||||
-rw-r--r-- | arch/arm/plat-samsung/adc.c | 5 |
2 files changed, 0 insertions, 10 deletions
diff --git a/arch/arm/mach-tegra/tegra2_emc.c b/arch/arm/mach-tegra/tegra2_emc.c index 9e8bdfa2b369..31e69a019bdd 100644 --- a/arch/arm/mach-tegra/tegra2_emc.c +++ b/arch/arm/mach-tegra/tegra2_emc.c | |||
@@ -307,11 +307,6 @@ static int tegra_emc_probe(struct platform_device *pdev) | |||
307 | } | 307 | } |
308 | 308 | ||
309 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 309 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
310 | if (!res) { | ||
311 | dev_err(&pdev->dev, "missing register base\n"); | ||
312 | return -ENOMEM; | ||
313 | } | ||
314 | |||
315 | emc_regbase = devm_ioremap_resource(&pdev->dev, res); | 310 | emc_regbase = devm_ioremap_resource(&pdev->dev, res); |
316 | if (IS_ERR(emc_regbase)) | 311 | if (IS_ERR(emc_regbase)) |
317 | return PTR_ERR(emc_regbase); | 312 | return PTR_ERR(emc_regbase); |
diff --git a/arch/arm/plat-samsung/adc.c b/arch/arm/plat-samsung/adc.c index ca07cb1b155a..79690f2f6d3f 100644 --- a/arch/arm/plat-samsung/adc.c +++ b/arch/arm/plat-samsung/adc.c | |||
@@ -381,11 +381,6 @@ static int s3c_adc_probe(struct platform_device *pdev) | |||
381 | } | 381 | } |
382 | 382 | ||
383 | regs = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 383 | regs = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
384 | if (!regs) { | ||
385 | dev_err(dev, "failed to find registers\n"); | ||
386 | return -ENXIO; | ||
387 | } | ||
388 | |||
389 | adc->regs = devm_ioremap_resource(dev, regs); | 384 | adc->regs = devm_ioremap_resource(dev, regs); |
390 | if (IS_ERR(adc->regs)) | 385 | if (IS_ERR(adc->regs)) |
391 | return PTR_ERR(adc->regs); | 386 | return PTR_ERR(adc->regs); |