aboutsummaryrefslogtreecommitdiffstats
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
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 ...
-rw-r--r--arch/arm/mach-tegra/tegra2_emc.c5
-rw-r--r--arch/arm/plat-samsung/adc.c5
-rw-r--r--arch/mips/lantiq/xway/gptu.c4
-rw-r--r--drivers/ata/pata_ep93xx.c5
-rw-r--r--drivers/char/hw_random/mxc-rnga.c6
-rw-r--r--drivers/char/hw_random/omap-rng.c5
-rw-r--r--drivers/dma/tegra20-apb-dma.c5
-rw-r--r--drivers/gpio/gpio-mvebu.c5
-rw-r--r--drivers/gpio/gpio-tegra.c5
-rw-r--r--drivers/gpu/drm/exynos/exynos_hdmi.c5
-rw-r--r--drivers/gpu/host1x/drm/dc.c5
-rw-r--r--drivers/i2c/busses/i2c-s3c2410.c5
-rw-r--r--drivers/i2c/busses/i2c-sirf.c6
-rw-r--r--drivers/i2c/busses/i2c-tegra.c5
-rw-r--r--drivers/memory/emif.c6
-rw-r--r--drivers/mfd/intel_msic.c5
-rw-r--r--drivers/misc/atmel-ssc.c5
-rw-r--r--drivers/mtd/nand/lpc32xx_mlc.c5
-rw-r--r--drivers/net/ethernet/renesas/sh_eth.c5
-rw-r--r--drivers/pinctrl/pinctrl-coh901.c5
-rw-r--r--drivers/pinctrl/pinctrl-exynos5440.c5
-rw-r--r--drivers/pinctrl/pinctrl-samsung.c5
-rw-r--r--drivers/pinctrl/pinctrl-xway.c4
-rw-r--r--drivers/pwm/pwm-imx.c5
-rw-r--r--drivers/pwm/pwm-puv3.c5
-rw-r--r--drivers/pwm/pwm-pxa.c5
-rw-r--r--drivers/pwm/pwm-tegra.c5
-rw-r--r--drivers/pwm/pwm-tiecap.c5
-rw-r--r--drivers/pwm/pwm-tiehrpwm.c5
-rw-r--r--drivers/pwm/pwm-tipwmss.c5
-rw-r--r--drivers/pwm/pwm-vt8500.c5
-rw-r--r--drivers/rtc/rtc-nuc900.c5
-rw-r--r--drivers/rtc/rtc-omap.c5
-rw-r--r--drivers/rtc/rtc-s3c.c5
-rw-r--r--drivers/rtc/rtc-tegra.c6
-rw-r--r--drivers/spi/spi-tegra20-sflash.c5
-rw-r--r--drivers/staging/dwc2/platform.c5
-rw-r--r--drivers/staging/nvec/nvec.c5
-rw-r--r--drivers/thermal/armada_thermal.c10
-rw-r--r--drivers/thermal/dove_thermal.c4
-rw-r--r--drivers/thermal/exynos_thermal.c5
-rw-r--r--drivers/usb/chipidea/core.c5
-rw-r--r--drivers/usb/gadget/bcm63xx_udc.c10
-rw-r--r--drivers/usb/host/ohci-nxp.c6
-rw-r--r--drivers/usb/phy/phy-mv-u3d-usb.c5
-rw-r--r--drivers/usb/phy/phy-mxs-usb.c5
-rw-r--r--drivers/usb/phy/phy-samsung-usb2.c5
-rw-r--r--drivers/usb/phy/phy-samsung-usb3.c5
-rw-r--r--drivers/video/omap2/dss/hdmi.c4
-rw-r--r--drivers/video/omap2/vrfb.c5
-rw-r--r--drivers/w1/masters/omap_hdq.c5
-rw-r--r--drivers/watchdog/ath79_wdt.c5
-rw-r--r--drivers/watchdog/davinci_wdt.c5
-rw-r--r--drivers/watchdog/imx2_wdt.c5
-rw-r--r--sound/soc/fsl/imx-ssi.c6
-rw-r--r--sound/soc/kirkwood/kirkwood-i2s.c5
56 files changed, 0 insertions, 292 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);
diff --git a/arch/mips/lantiq/xway/gptu.c b/arch/mips/lantiq/xway/gptu.c
index 4fa577c1ddfd..850821df924c 100644
--- a/arch/mips/lantiq/xway/gptu.c
+++ b/arch/mips/lantiq/xway/gptu.c
@@ -144,10 +144,6 @@ static int gptu_probe(struct platform_device *pdev)
144 } 144 }
145 145
146 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 146 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
147 if (!res) {
148 dev_err(&pdev->dev, "Failed to get resource\n");
149 return -ENOMEM;
150 }
151 147
152 /* remap gptu register range */ 148 /* remap gptu register range */
153 gptu_membase = devm_ioremap_resource(&pdev->dev, res); 149 gptu_membase = devm_ioremap_resource(&pdev->dev, res);
diff --git a/drivers/ata/pata_ep93xx.c b/drivers/ata/pata_ep93xx.c
index c1bfaf43d109..980b88e109fc 100644
--- a/drivers/ata/pata_ep93xx.c
+++ b/drivers/ata/pata_ep93xx.c
@@ -933,11 +933,6 @@ static int ep93xx_pata_probe(struct platform_device *pdev)
933 } 933 }
934 934
935 mem_res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 935 mem_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
936 if (!mem_res) {
937 err = -ENXIO;
938 goto err_rel_gpio;
939 }
940
941 ide_base = devm_ioremap_resource(&pdev->dev, mem_res); 936 ide_base = devm_ioremap_resource(&pdev->dev, mem_res);
942 if (IS_ERR(ide_base)) { 937 if (IS_ERR(ide_base)) {
943 err = PTR_ERR(ide_base); 938 err = PTR_ERR(ide_base);
diff --git a/drivers/char/hw_random/mxc-rnga.c b/drivers/char/hw_random/mxc-rnga.c
index 4ca35e8a5d8c..19a12ac64a9e 100644
--- a/drivers/char/hw_random/mxc-rnga.c
+++ b/drivers/char/hw_random/mxc-rnga.c
@@ -167,11 +167,6 @@ static int __init mxc_rnga_probe(struct platform_device *pdev)
167 clk_prepare_enable(mxc_rng->clk); 167 clk_prepare_enable(mxc_rng->clk);
168 168
169 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 169 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
170 if (!res) {
171 err = -ENOENT;
172 goto err_region;
173 }
174
175 mxc_rng->mem = devm_ioremap_resource(&pdev->dev, res); 170 mxc_rng->mem = devm_ioremap_resource(&pdev->dev, res);
176 if (IS_ERR(mxc_rng->mem)) { 171 if (IS_ERR(mxc_rng->mem)) {
177 err = PTR_ERR(mxc_rng->mem); 172 err = PTR_ERR(mxc_rng->mem);
@@ -189,7 +184,6 @@ static int __init mxc_rnga_probe(struct platform_device *pdev)
189 return 0; 184 return 0;
190 185
191err_ioremap: 186err_ioremap:
192err_region:
193 clk_disable_unprepare(mxc_rng->clk); 187 clk_disable_unprepare(mxc_rng->clk);
194 188
195out: 189out:
diff --git a/drivers/char/hw_random/omap-rng.c b/drivers/char/hw_random/omap-rng.c
index 749dc16ca2cc..d2903e772270 100644
--- a/drivers/char/hw_random/omap-rng.c
+++ b/drivers/char/hw_random/omap-rng.c
@@ -119,11 +119,6 @@ static int omap_rng_probe(struct platform_device *pdev)
119 dev_set_drvdata(&pdev->dev, priv); 119 dev_set_drvdata(&pdev->dev, priv);
120 120
121 priv->mem_res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 121 priv->mem_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
122 if (!priv->mem_res) {
123 ret = -ENOENT;
124 goto err_ioremap;
125 }
126
127 priv->base = devm_ioremap_resource(&pdev->dev, priv->mem_res); 122 priv->base = devm_ioremap_resource(&pdev->dev, priv->mem_res);
128 if (IS_ERR(priv->base)) { 123 if (IS_ERR(priv->base)) {
129 ret = PTR_ERR(priv->base); 124 ret = PTR_ERR(priv->base);
diff --git a/drivers/dma/tegra20-apb-dma.c b/drivers/dma/tegra20-apb-dma.c
index ce193409ebd3..33f59ecd256e 100644
--- a/drivers/dma/tegra20-apb-dma.c
+++ b/drivers/dma/tegra20-apb-dma.c
@@ -1273,11 +1273,6 @@ static int tegra_dma_probe(struct platform_device *pdev)
1273 platform_set_drvdata(pdev, tdma); 1273 platform_set_drvdata(pdev, tdma);
1274 1274
1275 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 1275 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
1276 if (!res) {
1277 dev_err(&pdev->dev, "No mem resource for DMA\n");
1278 return -EINVAL;
1279 }
1280
1281 tdma->base_addr = devm_ioremap_resource(&pdev->dev, res); 1276 tdma->base_addr = devm_ioremap_resource(&pdev->dev, res);
1282 if (IS_ERR(tdma->base_addr)) 1277 if (IS_ERR(tdma->base_addr))
1283 return PTR_ERR(tdma->base_addr); 1278 return PTR_ERR(tdma->base_addr);
diff --git a/drivers/gpio/gpio-mvebu.c b/drivers/gpio/gpio-mvebu.c
index bf69a7eff370..3a4816adc137 100644
--- a/drivers/gpio/gpio-mvebu.c
+++ b/drivers/gpio/gpio-mvebu.c
@@ -619,11 +619,6 @@ static int mvebu_gpio_probe(struct platform_device *pdev)
619 * per-CPU registers */ 619 * per-CPU registers */
620 if (soc_variant == MVEBU_GPIO_SOC_VARIANT_ARMADAXP) { 620 if (soc_variant == MVEBU_GPIO_SOC_VARIANT_ARMADAXP) {
621 res = platform_get_resource(pdev, IORESOURCE_MEM, 1); 621 res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
622 if (!res) {
623 dev_err(&pdev->dev, "Cannot get memory resource\n");
624 return -ENODEV;
625 }
626
627 mvchip->percpu_membase = devm_ioremap_resource(&pdev->dev, 622 mvchip->percpu_membase = devm_ioremap_resource(&pdev->dev,
628 res); 623 res);
629 if (IS_ERR(mvchip->percpu_membase)) 624 if (IS_ERR(mvchip->percpu_membase))
diff --git a/drivers/gpio/gpio-tegra.c b/drivers/gpio/gpio-tegra.c
index da4cb5b0cb87..9a62672f1bed 100644
--- a/drivers/gpio/gpio-tegra.c
+++ b/drivers/gpio/gpio-tegra.c
@@ -463,11 +463,6 @@ static int tegra_gpio_probe(struct platform_device *pdev)
463 } 463 }
464 464
465 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 465 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
466 if (!res) {
467 dev_err(&pdev->dev, "Missing MEM resource\n");
468 return -ENODEV;
469 }
470
471 regs = devm_ioremap_resource(&pdev->dev, res); 466 regs = devm_ioremap_resource(&pdev->dev, res);
472 if (IS_ERR(regs)) 467 if (IS_ERR(regs))
473 return PTR_ERR(regs); 468 return PTR_ERR(regs);
diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c
index bbfc3840080c..6652597586a1 100644
--- a/drivers/gpu/drm/exynos/exynos_hdmi.c
+++ b/drivers/gpu/drm/exynos/exynos_hdmi.c
@@ -2005,11 +2005,6 @@ static int hdmi_probe(struct platform_device *pdev)
2005 } 2005 }
2006 2006
2007 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 2007 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
2008 if (!res) {
2009 DRM_ERROR("failed to find registers\n");
2010 return -ENOENT;
2011 }
2012
2013 hdata->regs = devm_ioremap_resource(&pdev->dev, res); 2008 hdata->regs = devm_ioremap_resource(&pdev->dev, res);
2014 if (IS_ERR(hdata->regs)) 2009 if (IS_ERR(hdata->regs))
2015 return PTR_ERR(hdata->regs); 2010 return PTR_ERR(hdata->regs);
diff --git a/drivers/gpu/host1x/drm/dc.c b/drivers/gpu/host1x/drm/dc.c
index 1e2060324f02..8c04943f82e3 100644
--- a/drivers/gpu/host1x/drm/dc.c
+++ b/drivers/gpu/host1x/drm/dc.c
@@ -1128,11 +1128,6 @@ static int tegra_dc_probe(struct platform_device *pdev)
1128 return err; 1128 return err;
1129 1129
1130 regs = platform_get_resource(pdev, IORESOURCE_MEM, 0); 1130 regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
1131 if (!regs) {
1132 dev_err(&pdev->dev, "failed to get registers\n");
1133 return -ENXIO;
1134 }
1135
1136 dc->regs = devm_ioremap_resource(&pdev->dev, regs); 1131 dc->regs = devm_ioremap_resource(&pdev->dev, regs);
1137 if (IS_ERR(dc->regs)) 1132 if (IS_ERR(dc->regs))
1138 return PTR_ERR(dc->regs); 1133 return PTR_ERR(dc->regs);
diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c
index 6e8ee92ab553..cab1c91b75a3 100644
--- a/drivers/i2c/busses/i2c-s3c2410.c
+++ b/drivers/i2c/busses/i2c-s3c2410.c
@@ -1082,11 +1082,6 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev)
1082 /* map the registers */ 1082 /* map the registers */
1083 1083
1084 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 1084 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
1085 if (res == NULL) {
1086 dev_err(&pdev->dev, "cannot find IO resource\n");
1087 return -ENOENT;
1088 }
1089
1090 i2c->regs = devm_ioremap_resource(&pdev->dev, res); 1085 i2c->regs = devm_ioremap_resource(&pdev->dev, res);
1091 1086
1092 if (IS_ERR(i2c->regs)) 1087 if (IS_ERR(i2c->regs))
diff --git a/drivers/i2c/busses/i2c-sirf.c b/drivers/i2c/busses/i2c-sirf.c
index 5a7ad240bd26..a63c7d506836 100644
--- a/drivers/i2c/busses/i2c-sirf.c
+++ b/drivers/i2c/busses/i2c-sirf.c
@@ -303,12 +303,6 @@ static int i2c_sirfsoc_probe(struct platform_device *pdev)
303 adap->class = I2C_CLASS_HWMON; 303 adap->class = I2C_CLASS_HWMON;
304 304
305 mem_res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 305 mem_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
306 if (mem_res == NULL) {
307 dev_err(&pdev->dev, "Unable to get MEM resource\n");
308 err = -EINVAL;
309 goto out;
310 }
311
312 siic->base = devm_ioremap_resource(&pdev->dev, mem_res); 306 siic->base = devm_ioremap_resource(&pdev->dev, mem_res);
313 if (IS_ERR(siic->base)) { 307 if (IS_ERR(siic->base)) {
314 err = PTR_ERR(siic->base); 308 err = PTR_ERR(siic->base);
diff --git a/drivers/i2c/busses/i2c-tegra.c b/drivers/i2c/busses/i2c-tegra.c
index b60ff90adc39..9aa1b60f7fdd 100644
--- a/drivers/i2c/busses/i2c-tegra.c
+++ b/drivers/i2c/busses/i2c-tegra.c
@@ -714,11 +714,6 @@ static int tegra_i2c_probe(struct platform_device *pdev)
714 int ret = 0; 714 int ret = 0;
715 715
716 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 716 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
717 if (!res) {
718 dev_err(&pdev->dev, "no mem resource\n");
719 return -EINVAL;
720 }
721
722 base = devm_ioremap_resource(&pdev->dev, res); 717 base = devm_ioremap_resource(&pdev->dev, res);
723 if (IS_ERR(base)) 718 if (IS_ERR(base))
724 return PTR_ERR(base); 719 return PTR_ERR(base);
diff --git a/drivers/memory/emif.c b/drivers/memory/emif.c
index cadf1cc19aaf..04644e7b42b1 100644
--- a/drivers/memory/emif.c
+++ b/drivers/memory/emif.c
@@ -1560,12 +1560,6 @@ static int __init_or_module emif_probe(struct platform_device *pdev)
1560 platform_set_drvdata(pdev, emif); 1560 platform_set_drvdata(pdev, emif);
1561 1561
1562 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 1562 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
1563 if (!res) {
1564 dev_err(emif->dev, "%s: error getting memory resource\n",
1565 __func__);
1566 goto error;
1567 }
1568
1569 emif->base = devm_ioremap_resource(emif->dev, res); 1563 emif->base = devm_ioremap_resource(emif->dev, res);
1570 if (IS_ERR(emif->base)) 1564 if (IS_ERR(emif->base))
1571 goto error; 1565 goto error;
diff --git a/drivers/mfd/intel_msic.c b/drivers/mfd/intel_msic.c
index 5be3b5e13855..d8d5137f9717 100644
--- a/drivers/mfd/intel_msic.c
+++ b/drivers/mfd/intel_msic.c
@@ -414,11 +414,6 @@ static int intel_msic_probe(struct platform_device *pdev)
414 * the clients via intel_msic_irq_read(). 414 * the clients via intel_msic_irq_read().
415 */ 415 */
416 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 416 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
417 if (!res) {
418 dev_err(&pdev->dev, "failed to get SRAM iomem resource\n");
419 return -ENODEV;
420 }
421
422 msic->irq_base = devm_ioremap_resource(&pdev->dev, res); 417 msic->irq_base = devm_ioremap_resource(&pdev->dev, res);
423 if (IS_ERR(msic->irq_base)) 418 if (IS_ERR(msic->irq_base))
424 return PTR_ERR(msic->irq_base); 419 return PTR_ERR(msic->irq_base);
diff --git a/drivers/misc/atmel-ssc.c b/drivers/misc/atmel-ssc.c
index c09c28f92055..1abd5ad59925 100644
--- a/drivers/misc/atmel-ssc.c
+++ b/drivers/misc/atmel-ssc.c
@@ -154,11 +154,6 @@ static int ssc_probe(struct platform_device *pdev)
154 ssc->pdata = (struct atmel_ssc_platform_data *)plat_dat; 154 ssc->pdata = (struct atmel_ssc_platform_data *)plat_dat;
155 155
156 regs = platform_get_resource(pdev, IORESOURCE_MEM, 0); 156 regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
157 if (!regs) {
158 dev_dbg(&pdev->dev, "no mmio resource defined\n");
159 return -ENXIO;
160 }
161
162 ssc->regs = devm_ioremap_resource(&pdev->dev, regs); 157 ssc->regs = devm_ioremap_resource(&pdev->dev, regs);
163 if (IS_ERR(ssc->regs)) 158 if (IS_ERR(ssc->regs))
164 return PTR_ERR(ssc->regs); 159 return PTR_ERR(ssc->regs);
diff --git a/drivers/mtd/nand/lpc32xx_mlc.c b/drivers/mtd/nand/lpc32xx_mlc.c
index a94facb46e5c..fd1df5e13ae4 100644
--- a/drivers/mtd/nand/lpc32xx_mlc.c
+++ b/drivers/mtd/nand/lpc32xx_mlc.c
@@ -672,11 +672,6 @@ static int lpc32xx_nand_probe(struct platform_device *pdev)
672 } 672 }
673 673
674 rc = platform_get_resource(pdev, IORESOURCE_MEM, 0); 674 rc = platform_get_resource(pdev, IORESOURCE_MEM, 0);
675 if (rc == NULL) {
676 dev_err(&pdev->dev, "No memory resource found for device!\r\n");
677 return -ENXIO;
678 }
679
680 host->io_base = devm_ioremap_resource(&pdev->dev, rc); 675 host->io_base = devm_ioremap_resource(&pdev->dev, rc);
681 if (IS_ERR(host->io_base)) 676 if (IS_ERR(host->io_base))
682 return PTR_ERR(host->io_base); 677 return PTR_ERR(host->io_base);
diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
index 33dc6f2418f2..42e9dd05c936 100644
--- a/drivers/net/ethernet/renesas/sh_eth.c
+++ b/drivers/net/ethernet/renesas/sh_eth.c
@@ -2745,11 +2745,6 @@ static int sh_eth_drv_probe(struct platform_device *pdev)
2745 if (mdp->cd->tsu) { 2745 if (mdp->cd->tsu) {
2746 struct resource *rtsu; 2746 struct resource *rtsu;
2747 rtsu = platform_get_resource(pdev, IORESOURCE_MEM, 1); 2747 rtsu = platform_get_resource(pdev, IORESOURCE_MEM, 1);
2748 if (!rtsu) {
2749 dev_err(&pdev->dev, "Not found TSU resource\n");
2750 ret = -ENODEV;
2751 goto out_release;
2752 }
2753 mdp->tsu_addr = devm_ioremap_resource(&pdev->dev, rtsu); 2748 mdp->tsu_addr = devm_ioremap_resource(&pdev->dev, rtsu);
2754 if (IS_ERR(mdp->tsu_addr)) { 2749 if (IS_ERR(mdp->tsu_addr)) {
2755 ret = PTR_ERR(mdp->tsu_addr); 2750 ret = PTR_ERR(mdp->tsu_addr);
diff --git a/drivers/pinctrl/pinctrl-coh901.c b/drivers/pinctrl/pinctrl-coh901.c
index edde3acc4186..a67af419f531 100644
--- a/drivers/pinctrl/pinctrl-coh901.c
+++ b/drivers/pinctrl/pinctrl-coh901.c
@@ -713,11 +713,6 @@ static int __init u300_gpio_probe(struct platform_device *pdev)
713 gpio->dev = &pdev->dev; 713 gpio->dev = &pdev->dev;
714 714
715 memres = platform_get_resource(pdev, IORESOURCE_MEM, 0); 715 memres = platform_get_resource(pdev, IORESOURCE_MEM, 0);
716 if (!memres) {
717 dev_err(gpio->dev, "could not get GPIO memory resource\n");
718 return -ENODEV;
719 }
720
721 gpio->base = devm_ioremap_resource(&pdev->dev, memres); 716 gpio->base = devm_ioremap_resource(&pdev->dev, memres);
722 if (IS_ERR(gpio->base)) 717 if (IS_ERR(gpio->base))
723 return PTR_ERR(gpio->base); 718 return PTR_ERR(gpio->base);
diff --git a/drivers/pinctrl/pinctrl-exynos5440.c b/drivers/pinctrl/pinctrl-exynos5440.c
index 6038503ed929..32a48f44f574 100644
--- a/drivers/pinctrl/pinctrl-exynos5440.c
+++ b/drivers/pinctrl/pinctrl-exynos5440.c
@@ -1000,11 +1000,6 @@ static int exynos5440_pinctrl_probe(struct platform_device *pdev)
1000 } 1000 }
1001 1001
1002 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 1002 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
1003 if (!res) {
1004 dev_err(dev, "cannot find IO resource\n");
1005 return -ENOENT;
1006 }
1007
1008 priv->reg_base = devm_ioremap_resource(&pdev->dev, res); 1003 priv->reg_base = devm_ioremap_resource(&pdev->dev, res);
1009 if (IS_ERR(priv->reg_base)) 1004 if (IS_ERR(priv->reg_base))
1010 return PTR_ERR(priv->reg_base); 1005 return PTR_ERR(priv->reg_base);
diff --git a/drivers/pinctrl/pinctrl-samsung.c b/drivers/pinctrl/pinctrl-samsung.c
index 976366899f68..055d0162098b 100644
--- a/drivers/pinctrl/pinctrl-samsung.c
+++ b/drivers/pinctrl/pinctrl-samsung.c
@@ -932,11 +932,6 @@ static int samsung_pinctrl_probe(struct platform_device *pdev)
932 drvdata->dev = dev; 932 drvdata->dev = dev;
933 933
934 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 934 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
935 if (!res) {
936 dev_err(dev, "cannot find IO resource\n");
937 return -ENOENT;
938 }
939
940 drvdata->virt_base = devm_ioremap_resource(&pdev->dev, res); 935 drvdata->virt_base = devm_ioremap_resource(&pdev->dev, res);
941 if (IS_ERR(drvdata->virt_base)) 936 if (IS_ERR(drvdata->virt_base))
942 return PTR_ERR(drvdata->virt_base); 937 return PTR_ERR(drvdata->virt_base);
diff --git a/drivers/pinctrl/pinctrl-xway.c b/drivers/pinctrl/pinctrl-xway.c
index f2977cff8366..e92132c76a6b 100644
--- a/drivers/pinctrl/pinctrl-xway.c
+++ b/drivers/pinctrl/pinctrl-xway.c
@@ -716,10 +716,6 @@ static int pinmux_xway_probe(struct platform_device *pdev)
716 716
717 /* get and remap our register range */ 717 /* get and remap our register range */
718 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 718 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
719 if (!res) {
720 dev_err(&pdev->dev, "Failed to get resource\n");
721 return -ENOENT;
722 }
723 xway_info.membase[0] = devm_ioremap_resource(&pdev->dev, res); 719 xway_info.membase[0] = devm_ioremap_resource(&pdev->dev, res);
724 if (IS_ERR(xway_info.membase[0])) 720 if (IS_ERR(xway_info.membase[0]))
725 return PTR_ERR(xway_info.membase[0]); 721 return PTR_ERR(xway_info.membase[0]);
diff --git a/drivers/pwm/pwm-imx.c b/drivers/pwm/pwm-imx.c
index ec287989eafc..c938bae18812 100644
--- a/drivers/pwm/pwm-imx.c
+++ b/drivers/pwm/pwm-imx.c
@@ -265,11 +265,6 @@ static int imx_pwm_probe(struct platform_device *pdev)
265 imx->chip.npwm = 1; 265 imx->chip.npwm = 1;
266 266
267 r = platform_get_resource(pdev, IORESOURCE_MEM, 0); 267 r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
268 if (r == NULL) {
269 dev_err(&pdev->dev, "no memory resource defined\n");
270 return -ENODEV;
271 }
272
273 imx->mmio_base = devm_ioremap_resource(&pdev->dev, r); 268 imx->mmio_base = devm_ioremap_resource(&pdev->dev, r);
274 if (IS_ERR(imx->mmio_base)) 269 if (IS_ERR(imx->mmio_base))
275 return PTR_ERR(imx->mmio_base); 270 return PTR_ERR(imx->mmio_base);
diff --git a/drivers/pwm/pwm-puv3.c b/drivers/pwm/pwm-puv3.c
index d1eb499fb15d..ed6007b27585 100644
--- a/drivers/pwm/pwm-puv3.c
+++ b/drivers/pwm/pwm-puv3.c
@@ -117,11 +117,6 @@ static int pwm_probe(struct platform_device *pdev)
117 return PTR_ERR(puv3->clk); 117 return PTR_ERR(puv3->clk);
118 118
119 r = platform_get_resource(pdev, IORESOURCE_MEM, 0); 119 r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
120 if (r == NULL) {
121 dev_err(&pdev->dev, "no memory resource defined\n");
122 return -ENODEV;
123 }
124
125 puv3->base = devm_ioremap_resource(&pdev->dev, r); 120 puv3->base = devm_ioremap_resource(&pdev->dev, r);
126 if (IS_ERR(puv3->base)) 121 if (IS_ERR(puv3->base))
127 return PTR_ERR(puv3->base); 122 return PTR_ERR(puv3->base);
diff --git a/drivers/pwm/pwm-pxa.c b/drivers/pwm/pwm-pxa.c
index dee6ab552a0a..dc9717551d39 100644
--- a/drivers/pwm/pwm-pxa.c
+++ b/drivers/pwm/pwm-pxa.c
@@ -147,11 +147,6 @@ static int pwm_probe(struct platform_device *pdev)
147 pwm->chip.npwm = (id->driver_data & HAS_SECONDARY_PWM) ? 2 : 1; 147 pwm->chip.npwm = (id->driver_data & HAS_SECONDARY_PWM) ? 2 : 1;
148 148
149 r = platform_get_resource(pdev, IORESOURCE_MEM, 0); 149 r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
150 if (r == NULL) {
151 dev_err(&pdev->dev, "no memory resource defined\n");
152 return -ENODEV;
153 }
154
155 pwm->mmio_base = devm_ioremap_resource(&pdev->dev, r); 150 pwm->mmio_base = devm_ioremap_resource(&pdev->dev, r);
156 if (IS_ERR(pwm->mmio_base)) 151 if (IS_ERR(pwm->mmio_base))
157 return PTR_ERR(pwm->mmio_base); 152 return PTR_ERR(pwm->mmio_base);
diff --git a/drivers/pwm/pwm-tegra.c b/drivers/pwm/pwm-tegra.c
index 3d75f4a88f98..a5402933001f 100644
--- a/drivers/pwm/pwm-tegra.c
+++ b/drivers/pwm/pwm-tegra.c
@@ -181,11 +181,6 @@ static int tegra_pwm_probe(struct platform_device *pdev)
181 pwm->dev = &pdev->dev; 181 pwm->dev = &pdev->dev;
182 182
183 r = platform_get_resource(pdev, IORESOURCE_MEM, 0); 183 r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
184 if (!r) {
185 dev_err(&pdev->dev, "no memory resources defined\n");
186 return -ENODEV;
187 }
188
189 pwm->mmio_base = devm_ioremap_resource(&pdev->dev, r); 184 pwm->mmio_base = devm_ioremap_resource(&pdev->dev, r);
190 if (IS_ERR(pwm->mmio_base)) 185 if (IS_ERR(pwm->mmio_base))
191 return PTR_ERR(pwm->mmio_base); 186 return PTR_ERR(pwm->mmio_base);
diff --git a/drivers/pwm/pwm-tiecap.c b/drivers/pwm/pwm-tiecap.c
index 0d65fb2e02c7..72ca42dfa733 100644
--- a/drivers/pwm/pwm-tiecap.c
+++ b/drivers/pwm/pwm-tiecap.c
@@ -240,11 +240,6 @@ static int ecap_pwm_probe(struct platform_device *pdev)
240 pc->chip.npwm = 1; 240 pc->chip.npwm = 1;
241 241
242 r = platform_get_resource(pdev, IORESOURCE_MEM, 0); 242 r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
243 if (!r) {
244 dev_err(&pdev->dev, "no memory resource defined\n");
245 return -ENODEV;
246 }
247
248 pc->mmio_base = devm_ioremap_resource(&pdev->dev, r); 243 pc->mmio_base = devm_ioremap_resource(&pdev->dev, r);
249 if (IS_ERR(pc->mmio_base)) 244 if (IS_ERR(pc->mmio_base))
250 return PTR_ERR(pc->mmio_base); 245 return PTR_ERR(pc->mmio_base);
diff --git a/drivers/pwm/pwm-tiehrpwm.c b/drivers/pwm/pwm-tiehrpwm.c
index 6a217596942f..48a485c2e422 100644
--- a/drivers/pwm/pwm-tiehrpwm.c
+++ b/drivers/pwm/pwm-tiehrpwm.c
@@ -471,11 +471,6 @@ static int ehrpwm_pwm_probe(struct platform_device *pdev)
471 pc->chip.npwm = NUM_PWM_CHANNEL; 471 pc->chip.npwm = NUM_PWM_CHANNEL;
472 472
473 r = platform_get_resource(pdev, IORESOURCE_MEM, 0); 473 r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
474 if (!r) {
475 dev_err(&pdev->dev, "no memory resource defined\n");
476 return -ENODEV;
477 }
478
479 pc->mmio_base = devm_ioremap_resource(&pdev->dev, r); 474 pc->mmio_base = devm_ioremap_resource(&pdev->dev, r);
480 if (IS_ERR(pc->mmio_base)) 475 if (IS_ERR(pc->mmio_base))
481 return PTR_ERR(pc->mmio_base); 476 return PTR_ERR(pc->mmio_base);
diff --git a/drivers/pwm/pwm-tipwmss.c b/drivers/pwm/pwm-tipwmss.c
index c9c3d3a1e0eb..3b119bc2c3c6 100644
--- a/drivers/pwm/pwm-tipwmss.c
+++ b/drivers/pwm/pwm-tipwmss.c
@@ -70,11 +70,6 @@ static int pwmss_probe(struct platform_device *pdev)
70 mutex_init(&info->pwmss_lock); 70 mutex_init(&info->pwmss_lock);
71 71
72 r = platform_get_resource(pdev, IORESOURCE_MEM, 0); 72 r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
73 if (!r) {
74 dev_err(&pdev->dev, "no memory resource defined\n");
75 return -ENODEV;
76 }
77
78 info->mmio_base = devm_ioremap_resource(&pdev->dev, r); 73 info->mmio_base = devm_ioremap_resource(&pdev->dev, r);
79 if (IS_ERR(info->mmio_base)) 74 if (IS_ERR(info->mmio_base))
80 return PTR_ERR(info->mmio_base); 75 return PTR_ERR(info->mmio_base);
diff --git a/drivers/pwm/pwm-vt8500.c b/drivers/pwm/pwm-vt8500.c
index 69effd19afc7..323125abf3f4 100644
--- a/drivers/pwm/pwm-vt8500.c
+++ b/drivers/pwm/pwm-vt8500.c
@@ -230,11 +230,6 @@ static int vt8500_pwm_probe(struct platform_device *pdev)
230 } 230 }
231 231
232 r = platform_get_resource(pdev, IORESOURCE_MEM, 0); 232 r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
233 if (r == NULL) {
234 dev_err(&pdev->dev, "no memory resource defined\n");
235 return -ENODEV;
236 }
237
238 chip->base = devm_ioremap_resource(&pdev->dev, r); 233 chip->base = devm_ioremap_resource(&pdev->dev, r);
239 if (IS_ERR(chip->base)) 234 if (IS_ERR(chip->base))
240 return PTR_ERR(chip->base); 235 return PTR_ERR(chip->base);
diff --git a/drivers/rtc/rtc-nuc900.c b/drivers/rtc/rtc-nuc900.c
index f5dfb6e5e7d9..d592e2fe43f7 100644
--- a/drivers/rtc/rtc-nuc900.c
+++ b/drivers/rtc/rtc-nuc900.c
@@ -234,11 +234,6 @@ static int __init nuc900_rtc_probe(struct platform_device *pdev)
234 return -ENOMEM; 234 return -ENOMEM;
235 } 235 }
236 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 236 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
237 if (!res) {
238 dev_err(&pdev->dev, "platform_get_resource failed\n");
239 return -ENXIO;
240 }
241
242 nuc900_rtc->rtc_reg = devm_ioremap_resource(&pdev->dev, res); 237 nuc900_rtc->rtc_reg = devm_ioremap_resource(&pdev->dev, res);
243 if (IS_ERR(nuc900_rtc->rtc_reg)) 238 if (IS_ERR(nuc900_rtc->rtc_reg))
244 return PTR_ERR(nuc900_rtc->rtc_reg); 239 return PTR_ERR(nuc900_rtc->rtc_reg);
diff --git a/drivers/rtc/rtc-omap.c b/drivers/rtc/rtc-omap.c
index 4e1bdb832e37..b0ba3fc991ea 100644
--- a/drivers/rtc/rtc-omap.c
+++ b/drivers/rtc/rtc-omap.c
@@ -347,11 +347,6 @@ static int __init omap_rtc_probe(struct platform_device *pdev)
347 } 347 }
348 348
349 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 349 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
350 if (!res) {
351 pr_debug("%s: RTC resource data missing\n", pdev->name);
352 return -ENOENT;
353 }
354
355 rtc_base = devm_ioremap_resource(&pdev->dev, res); 350 rtc_base = devm_ioremap_resource(&pdev->dev, res);
356 if (IS_ERR(rtc_base)) 351 if (IS_ERR(rtc_base))
357 return PTR_ERR(rtc_base); 352 return PTR_ERR(rtc_base);
diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c
index 14040b22888d..0b495e8b8e66 100644
--- a/drivers/rtc/rtc-s3c.c
+++ b/drivers/rtc/rtc-s3c.c
@@ -477,11 +477,6 @@ static int s3c_rtc_probe(struct platform_device *pdev)
477 /* get the memory region */ 477 /* get the memory region */
478 478
479 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 479 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
480 if (res == NULL) {
481 dev_err(&pdev->dev, "failed to get memory region resource\n");
482 return -ENOENT;
483 }
484
485 s3c_rtc_base = devm_ioremap_resource(&pdev->dev, res); 480 s3c_rtc_base = devm_ioremap_resource(&pdev->dev, res);
486 if (IS_ERR(s3c_rtc_base)) 481 if (IS_ERR(s3c_rtc_base))
487 return PTR_ERR(s3c_rtc_base); 482 return PTR_ERR(s3c_rtc_base);
diff --git a/drivers/rtc/rtc-tegra.c b/drivers/rtc/rtc-tegra.c
index a34315d25478..76af92ad5a8a 100644
--- a/drivers/rtc/rtc-tegra.c
+++ b/drivers/rtc/rtc-tegra.c
@@ -322,12 +322,6 @@ static int __init tegra_rtc_probe(struct platform_device *pdev)
322 return -ENOMEM; 322 return -ENOMEM;
323 323
324 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 324 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
325 if (!res) {
326 dev_err(&pdev->dev,
327 "Unable to allocate resources for device.\n");
328 return -EBUSY;
329 }
330
331 info->rtc_base = devm_ioremap_resource(&pdev->dev, res); 325 info->rtc_base = devm_ioremap_resource(&pdev->dev, res);
332 if (IS_ERR(info->rtc_base)) 326 if (IS_ERR(info->rtc_base))
333 return PTR_ERR(info->rtc_base); 327 return PTR_ERR(info->rtc_base);
diff --git a/drivers/spi/spi-tegra20-sflash.c b/drivers/spi/spi-tegra20-sflash.c
index d65c000efe35..09df8e22dba0 100644
--- a/drivers/spi/spi-tegra20-sflash.c
+++ b/drivers/spi/spi-tegra20-sflash.c
@@ -489,11 +489,6 @@ static int tegra_sflash_probe(struct platform_device *pdev)
489 tegra_sflash_parse_dt(tsd); 489 tegra_sflash_parse_dt(tsd);
490 490
491 r = platform_get_resource(pdev, IORESOURCE_MEM, 0); 491 r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
492 if (!r) {
493 dev_err(&pdev->dev, "No IO memory resource\n");
494 ret = -ENODEV;
495 goto exit_free_master;
496 }
497 tsd->base = devm_ioremap_resource(&pdev->dev, r); 492 tsd->base = devm_ioremap_resource(&pdev->dev, r);
498 if (IS_ERR(tsd->base)) { 493 if (IS_ERR(tsd->base)) {
499 ret = PTR_ERR(tsd->base); 494 ret = PTR_ERR(tsd->base);
diff --git a/drivers/staging/dwc2/platform.c b/drivers/staging/dwc2/platform.c
index 1f3d581a1078..b610960e93d3 100644
--- a/drivers/staging/dwc2/platform.c
+++ b/drivers/staging/dwc2/platform.c
@@ -102,11 +102,6 @@ static int dwc2_driver_probe(struct platform_device *dev)
102 } 102 }
103 103
104 res = platform_get_resource(dev, IORESOURCE_MEM, 0); 104 res = platform_get_resource(dev, IORESOURCE_MEM, 0);
105 if (!res) {
106 dev_err(&dev->dev, "missing memory base resource\n");
107 return -EINVAL;
108 }
109
110 hsotg->regs = devm_ioremap_resource(&dev->dev, res); 105 hsotg->regs = devm_ioremap_resource(&dev->dev, res);
111 if (IS_ERR(hsotg->regs)) 106 if (IS_ERR(hsotg->regs))
112 return PTR_ERR(hsotg->regs); 107 return PTR_ERR(hsotg->regs);
diff --git a/drivers/staging/nvec/nvec.c b/drivers/staging/nvec/nvec.c
index a88959f9a07a..863b22e51b45 100644
--- a/drivers/staging/nvec/nvec.c
+++ b/drivers/staging/nvec/nvec.c
@@ -800,11 +800,6 @@ static int tegra_nvec_probe(struct platform_device *pdev)
800 } 800 }
801 801
802 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 802 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
803 if (!res) {
804 dev_err(&pdev->dev, "no mem resource?\n");
805 return -ENODEV;
806 }
807
808 base = devm_ioremap_resource(&pdev->dev, res); 803 base = devm_ioremap_resource(&pdev->dev, res);
809 if (IS_ERR(base)) 804 if (IS_ERR(base))
810 return PTR_ERR(base); 805 return PTR_ERR(base);
diff --git a/drivers/thermal/armada_thermal.c b/drivers/thermal/armada_thermal.c
index 5b4d75fd7b49..54ffd64ca3f7 100644
--- a/drivers/thermal/armada_thermal.c
+++ b/drivers/thermal/armada_thermal.c
@@ -169,21 +169,11 @@ static int armada_thermal_probe(struct platform_device *pdev)
169 return -ENOMEM; 169 return -ENOMEM;
170 170
171 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 171 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
172 if (!res) {
173 dev_err(&pdev->dev, "Failed to get platform resource\n");
174 return -ENODEV;
175 }
176
177 priv->sensor = devm_ioremap_resource(&pdev->dev, res); 172 priv->sensor = devm_ioremap_resource(&pdev->dev, res);
178 if (IS_ERR(priv->sensor)) 173 if (IS_ERR(priv->sensor))
179 return PTR_ERR(priv->sensor); 174 return PTR_ERR(priv->sensor);
180 175
181 res = platform_get_resource(pdev, IORESOURCE_MEM, 1); 176 res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
182 if (!res) {
183 dev_err(&pdev->dev, "Failed to get platform resource\n");
184 return -ENODEV;
185 }
186
187 priv->control = devm_ioremap_resource(&pdev->dev, res); 177 priv->control = devm_ioremap_resource(&pdev->dev, res);
188 if (IS_ERR(priv->control)) 178 if (IS_ERR(priv->control))
189 return PTR_ERR(priv->control); 179 return PTR_ERR(priv->control);
diff --git a/drivers/thermal/dove_thermal.c b/drivers/thermal/dove_thermal.c
index 4b15a5f270dc..a088d1365ca5 100644
--- a/drivers/thermal/dove_thermal.c
+++ b/drivers/thermal/dove_thermal.c
@@ -149,10 +149,6 @@ static int dove_thermal_probe(struct platform_device *pdev)
149 return PTR_ERR(priv->sensor); 149 return PTR_ERR(priv->sensor);
150 150
151 res = platform_get_resource(pdev, IORESOURCE_MEM, 1); 151 res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
152 if (!res) {
153 dev_err(&pdev->dev, "Failed to get platform resource\n");
154 return -ENODEV;
155 }
156 priv->control = devm_ioremap_resource(&pdev->dev, res); 152 priv->control = devm_ioremap_resource(&pdev->dev, res);
157 if (IS_ERR(priv->control)) 153 if (IS_ERR(priv->control))
158 return PTR_ERR(priv->control); 154 return PTR_ERR(priv->control);
diff --git a/drivers/thermal/exynos_thermal.c b/drivers/thermal/exynos_thermal.c
index d20ce9e61403..788b1ddcac6c 100644
--- a/drivers/thermal/exynos_thermal.c
+++ b/drivers/thermal/exynos_thermal.c
@@ -925,11 +925,6 @@ static int exynos_tmu_probe(struct platform_device *pdev)
925 INIT_WORK(&data->irq_work, exynos_tmu_work); 925 INIT_WORK(&data->irq_work, exynos_tmu_work);
926 926
927 data->mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); 927 data->mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
928 if (!data->mem) {
929 dev_err(&pdev->dev, "Failed to get platform resource\n");
930 return -ENOENT;
931 }
932
933 data->base = devm_ioremap_resource(&pdev->dev, data->mem); 928 data->base = devm_ioremap_resource(&pdev->dev, data->mem);
934 if (IS_ERR(data->base)) 929 if (IS_ERR(data->base))
935 return PTR_ERR(data->base); 930 return PTR_ERR(data->base);
diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c
index 450107e5f657..49b098bedf9b 100644
--- a/drivers/usb/chipidea/core.c
+++ b/drivers/usb/chipidea/core.c
@@ -370,11 +370,6 @@ static int ci_hdrc_probe(struct platform_device *pdev)
370 } 370 }
371 371
372 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 372 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
373 if (!res) {
374 dev_err(dev, "missing resource\n");
375 return -ENODEV;
376 }
377
378 base = devm_ioremap_resource(dev, res); 373 base = devm_ioremap_resource(dev, res);
379 if (IS_ERR(base)) 374 if (IS_ERR(base))
380 return PTR_ERR(base); 375 return PTR_ERR(base);
diff --git a/drivers/usb/gadget/bcm63xx_udc.c b/drivers/usb/gadget/bcm63xx_udc.c
index 6e6518264c42..792297798147 100644
--- a/drivers/usb/gadget/bcm63xx_udc.c
+++ b/drivers/usb/gadget/bcm63xx_udc.c
@@ -2334,21 +2334,11 @@ static int bcm63xx_udc_probe(struct platform_device *pdev)
2334 } 2334 }
2335 2335
2336 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 2336 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
2337 if (!res) {
2338 dev_err(dev, "error finding USBD resource\n");
2339 return -ENXIO;
2340 }
2341
2342 udc->usbd_regs = devm_ioremap_resource(dev, res); 2337 udc->usbd_regs = devm_ioremap_resource(dev, res);
2343 if (IS_ERR(udc->usbd_regs)) 2338 if (IS_ERR(udc->usbd_regs))
2344 return PTR_ERR(udc->usbd_regs); 2339 return PTR_ERR(udc->usbd_regs);
2345 2340
2346 res = platform_get_resource(pdev, IORESOURCE_MEM, 1); 2341 res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
2347 if (!res) {
2348 dev_err(dev, "error finding IUDMA resource\n");
2349 return -ENXIO;
2350 }
2351
2352 udc->iudma_regs = devm_ioremap_resource(dev, res); 2342 udc->iudma_regs = devm_ioremap_resource(dev, res);
2353 if (IS_ERR(udc->iudma_regs)) 2343 if (IS_ERR(udc->iudma_regs))
2354 return PTR_ERR(udc->iudma_regs); 2344 return PTR_ERR(udc->iudma_regs);
diff --git a/drivers/usb/host/ohci-nxp.c b/drivers/usb/host/ohci-nxp.c
index f4988fbe78e7..f303cb04c2dd 100644
--- a/drivers/usb/host/ohci-nxp.c
+++ b/drivers/usb/host/ohci-nxp.c
@@ -300,12 +300,6 @@ static int usb_hcd_nxp_probe(struct platform_device *pdev)
300 } 300 }
301 301
302 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 302 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
303 if (!res) {
304 dev_err(&pdev->dev, "Failed to get MEM resource\n");
305 ret = -ENOMEM;
306 goto out8;
307 }
308
309 hcd->regs = devm_ioremap_resource(&pdev->dev, res); 303 hcd->regs = devm_ioremap_resource(&pdev->dev, res);
310 if (IS_ERR(hcd->regs)) { 304 if (IS_ERR(hcd->regs)) {
311 ret = PTR_ERR(hcd->regs); 305 ret = PTR_ERR(hcd->regs);
diff --git a/drivers/usb/phy/phy-mv-u3d-usb.c b/drivers/usb/phy/phy-mv-u3d-usb.c
index f7838a43347c..1568ea63e338 100644
--- a/drivers/usb/phy/phy-mv-u3d-usb.c
+++ b/drivers/usb/phy/phy-mv-u3d-usb.c
@@ -278,11 +278,6 @@ static int mv_u3d_phy_probe(struct platform_device *pdev)
278 } 278 }
279 279
280 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 280 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
281 if (!res) {
282 dev_err(dev, "missing mem resource\n");
283 return -ENODEV;
284 }
285
286 phy_base = devm_ioremap_resource(dev, res); 281 phy_base = devm_ioremap_resource(dev, res);
287 if (IS_ERR(phy_base)) 282 if (IS_ERR(phy_base))
288 return PTR_ERR(phy_base); 283 return PTR_ERR(phy_base);
diff --git a/drivers/usb/phy/phy-mxs-usb.c b/drivers/usb/phy/phy-mxs-usb.c
index 9d4381e64d51..eb25dd2a1429 100644
--- a/drivers/usb/phy/phy-mxs-usb.c
+++ b/drivers/usb/phy/phy-mxs-usb.c
@@ -130,11 +130,6 @@ static int mxs_phy_probe(struct platform_device *pdev)
130 int ret; 130 int ret;
131 131
132 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 132 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
133 if (!res) {
134 dev_err(&pdev->dev, "can't get device resources\n");
135 return -ENOENT;
136 }
137
138 base = devm_ioremap_resource(&pdev->dev, res); 133 base = devm_ioremap_resource(&pdev->dev, res);
139 if (IS_ERR(base)) 134 if (IS_ERR(base))
140 return PTR_ERR(base); 135 return PTR_ERR(base);
diff --git a/drivers/usb/phy/phy-samsung-usb2.c b/drivers/usb/phy/phy-samsung-usb2.c
index 45ffe036dacc..9d5e273abcc7 100644
--- a/drivers/usb/phy/phy-samsung-usb2.c
+++ b/drivers/usb/phy/phy-samsung-usb2.c
@@ -363,11 +363,6 @@ static int samsung_usb2phy_probe(struct platform_device *pdev)
363 int ret; 363 int ret;
364 364
365 phy_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); 365 phy_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
366 if (!phy_mem) {
367 dev_err(dev, "%s: missing mem resource\n", __func__);
368 return -ENODEV;
369 }
370
371 phy_base = devm_ioremap_resource(dev, phy_mem); 366 phy_base = devm_ioremap_resource(dev, phy_mem);
372 if (IS_ERR(phy_base)) 367 if (IS_ERR(phy_base))
373 return PTR_ERR(phy_base); 368 return PTR_ERR(phy_base);
diff --git a/drivers/usb/phy/phy-samsung-usb3.c b/drivers/usb/phy/phy-samsung-usb3.c
index 133f3d0c554f..5a9efcbcb532 100644
--- a/drivers/usb/phy/phy-samsung-usb3.c
+++ b/drivers/usb/phy/phy-samsung-usb3.c
@@ -239,11 +239,6 @@ static int samsung_usb3phy_probe(struct platform_device *pdev)
239 int ret; 239 int ret;
240 240
241 phy_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); 241 phy_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
242 if (!phy_mem) {
243 dev_err(dev, "%s: missing mem resource\n", __func__);
244 return -ENODEV;
245 }
246
247 phy_base = devm_ioremap_resource(dev, phy_mem); 242 phy_base = devm_ioremap_resource(dev, phy_mem);
248 if (IS_ERR(phy_base)) 243 if (IS_ERR(phy_base))
249 return PTR_ERR(phy_base); 244 return PTR_ERR(phy_base);
diff --git a/drivers/video/omap2/dss/hdmi.c b/drivers/video/omap2/dss/hdmi.c
index 17f4d55c621c..a109934c0478 100644
--- a/drivers/video/omap2/dss/hdmi.c
+++ b/drivers/video/omap2/dss/hdmi.c
@@ -1065,10 +1065,6 @@ static int omapdss_hdmihw_probe(struct platform_device *pdev)
1065 mutex_init(&hdmi.ip_data.lock); 1065 mutex_init(&hdmi.ip_data.lock);
1066 1066
1067 res = platform_get_resource(hdmi.pdev, IORESOURCE_MEM, 0); 1067 res = platform_get_resource(hdmi.pdev, IORESOURCE_MEM, 0);
1068 if (!res) {
1069 DSSERR("can't get IORESOURCE_MEM HDMI\n");
1070 return -EINVAL;
1071 }
1072 1068
1073 /* Base address taken from platform */ 1069 /* Base address taken from platform */
1074 hdmi.ip_data.base_wp = devm_ioremap_resource(&pdev->dev, res); 1070 hdmi.ip_data.base_wp = devm_ioremap_resource(&pdev->dev, res);
diff --git a/drivers/video/omap2/vrfb.c b/drivers/video/omap2/vrfb.c
index 5261229c79af..f346b02eee1d 100644
--- a/drivers/video/omap2/vrfb.c
+++ b/drivers/video/omap2/vrfb.c
@@ -353,11 +353,6 @@ static int __init vrfb_probe(struct platform_device *pdev)
353 /* first resource is the register res, the rest are vrfb contexts */ 353 /* first resource is the register res, the rest are vrfb contexts */
354 354
355 mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); 355 mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
356 if (!mem) {
357 dev_err(&pdev->dev, "can't get vrfb base address\n");
358 return -EINVAL;
359 }
360
361 vrfb_base = devm_ioremap_resource(&pdev->dev, mem); 356 vrfb_base = devm_ioremap_resource(&pdev->dev, mem);
362 if (IS_ERR(vrfb_base)) 357 if (IS_ERR(vrfb_base))
363 return PTR_ERR(vrfb_base); 358 return PTR_ERR(vrfb_base);
diff --git a/drivers/w1/masters/omap_hdq.c b/drivers/w1/masters/omap_hdq.c
index db2390aed387..6e94d8dd3d00 100644
--- a/drivers/w1/masters/omap_hdq.c
+++ b/drivers/w1/masters/omap_hdq.c
@@ -555,11 +555,6 @@ static int omap_hdq_probe(struct platform_device *pdev)
555 platform_set_drvdata(pdev, hdq_data); 555 platform_set_drvdata(pdev, hdq_data);
556 556
557 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 557 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
558 if (!res) {
559 dev_dbg(&pdev->dev, "unable to get resource\n");
560 return -ENXIO;
561 }
562
563 hdq_data->hdq_base = devm_ioremap_resource(dev, res); 558 hdq_data->hdq_base = devm_ioremap_resource(dev, res);
564 if (IS_ERR(hdq_data->hdq_base)) 559 if (IS_ERR(hdq_data->hdq_base))
565 return PTR_ERR(hdq_data->hdq_base); 560 return PTR_ERR(hdq_data->hdq_base);
diff --git a/drivers/watchdog/ath79_wdt.c b/drivers/watchdog/ath79_wdt.c
index d184c48a0482..37cb09b27b63 100644
--- a/drivers/watchdog/ath79_wdt.c
+++ b/drivers/watchdog/ath79_wdt.c
@@ -248,11 +248,6 @@ static int ath79_wdt_probe(struct platform_device *pdev)
248 return -EBUSY; 248 return -EBUSY;
249 249
250 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 250 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
251 if (!res) {
252 dev_err(&pdev->dev, "no memory resource found\n");
253 return -EINVAL;
254 }
255
256 wdt_base = devm_ioremap_resource(&pdev->dev, res); 251 wdt_base = devm_ioremap_resource(&pdev->dev, res);
257 if (IS_ERR(wdt_base)) 252 if (IS_ERR(wdt_base))
258 return PTR_ERR(wdt_base); 253 return PTR_ERR(wdt_base);
diff --git a/drivers/watchdog/davinci_wdt.c b/drivers/watchdog/davinci_wdt.c
index 100d4fbfde2a..bead7740c86a 100644
--- a/drivers/watchdog/davinci_wdt.c
+++ b/drivers/watchdog/davinci_wdt.c
@@ -217,11 +217,6 @@ static int davinci_wdt_probe(struct platform_device *pdev)
217 dev_info(dev, "heartbeat %d sec\n", heartbeat); 217 dev_info(dev, "heartbeat %d sec\n", heartbeat);
218 218
219 wdt_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); 219 wdt_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
220 if (wdt_mem == NULL) {
221 dev_err(dev, "failed to get memory region resource\n");
222 return -ENOENT;
223 }
224
225 wdt_base = devm_ioremap_resource(dev, wdt_mem); 220 wdt_base = devm_ioremap_resource(dev, wdt_mem);
226 if (IS_ERR(wdt_base)) 221 if (IS_ERR(wdt_base))
227 return PTR_ERR(wdt_base); 222 return PTR_ERR(wdt_base);
diff --git a/drivers/watchdog/imx2_wdt.c b/drivers/watchdog/imx2_wdt.c
index ff908823688c..62946c2cb4f8 100644
--- a/drivers/watchdog/imx2_wdt.c
+++ b/drivers/watchdog/imx2_wdt.c
@@ -257,11 +257,6 @@ static int __init imx2_wdt_probe(struct platform_device *pdev)
257 struct resource *res; 257 struct resource *res;
258 258
259 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 259 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
260 if (!res) {
261 dev_err(&pdev->dev, "can't get device resources\n");
262 return -ENODEV;
263 }
264
265 imx2_wdt.base = devm_ioremap_resource(&pdev->dev, res); 260 imx2_wdt.base = devm_ioremap_resource(&pdev->dev, res);
266 if (IS_ERR(imx2_wdt.base)) 261 if (IS_ERR(imx2_wdt.base))
267 return PTR_ERR(imx2_wdt.base); 262 return PTR_ERR(imx2_wdt.base);
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);