Commit e5106682 authored by Linus Torvalds's avatar Linus Torvalds

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
  ...
parents ff9129b0 12716cd4
...@@ -307,11 +307,6 @@ static int tegra_emc_probe(struct platform_device *pdev) ...@@ -307,11 +307,6 @@ static int tegra_emc_probe(struct platform_device *pdev)
} }
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res) {
dev_err(&pdev->dev, "missing register base\n");
return -ENOMEM;
}
emc_regbase = devm_ioremap_resource(&pdev->dev, res); emc_regbase = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(emc_regbase)) if (IS_ERR(emc_regbase))
return PTR_ERR(emc_regbase); return PTR_ERR(emc_regbase);
......
...@@ -381,11 +381,6 @@ static int s3c_adc_probe(struct platform_device *pdev) ...@@ -381,11 +381,6 @@ static int s3c_adc_probe(struct platform_device *pdev)
} }
regs = platform_get_resource(pdev, IORESOURCE_MEM, 0); regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!regs) {
dev_err(dev, "failed to find registers\n");
return -ENXIO;
}
adc->regs = devm_ioremap_resource(dev, regs); adc->regs = devm_ioremap_resource(dev, regs);
if (IS_ERR(adc->regs)) if (IS_ERR(adc->regs))
return PTR_ERR(adc->regs); return PTR_ERR(adc->regs);
......
...@@ -144,10 +144,6 @@ static int gptu_probe(struct platform_device *pdev) ...@@ -144,10 +144,6 @@ static int gptu_probe(struct platform_device *pdev)
} }
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res) {
dev_err(&pdev->dev, "Failed to get resource\n");
return -ENOMEM;
}
/* remap gptu register range */ /* remap gptu register range */
gptu_membase = devm_ioremap_resource(&pdev->dev, res); gptu_membase = devm_ioremap_resource(&pdev->dev, res);
......
...@@ -933,11 +933,6 @@ static int ep93xx_pata_probe(struct platform_device *pdev) ...@@ -933,11 +933,6 @@ static int ep93xx_pata_probe(struct platform_device *pdev)
} }
mem_res = platform_get_resource(pdev, IORESOURCE_MEM, 0); mem_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!mem_res) {
err = -ENXIO;
goto err_rel_gpio;
}
ide_base = devm_ioremap_resource(&pdev->dev, mem_res); ide_base = devm_ioremap_resource(&pdev->dev, mem_res);
if (IS_ERR(ide_base)) { if (IS_ERR(ide_base)) {
err = PTR_ERR(ide_base); err = PTR_ERR(ide_base);
......
...@@ -167,11 +167,6 @@ static int __init mxc_rnga_probe(struct platform_device *pdev) ...@@ -167,11 +167,6 @@ static int __init mxc_rnga_probe(struct platform_device *pdev)
clk_prepare_enable(mxc_rng->clk); clk_prepare_enable(mxc_rng->clk);
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res) {
err = -ENOENT;
goto err_region;
}
mxc_rng->mem = devm_ioremap_resource(&pdev->dev, res); mxc_rng->mem = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(mxc_rng->mem)) { if (IS_ERR(mxc_rng->mem)) {
err = PTR_ERR(mxc_rng->mem); err = PTR_ERR(mxc_rng->mem);
...@@ -189,7 +184,6 @@ static int __init mxc_rnga_probe(struct platform_device *pdev) ...@@ -189,7 +184,6 @@ static int __init mxc_rnga_probe(struct platform_device *pdev)
return 0; return 0;
err_ioremap: err_ioremap:
err_region:
clk_disable_unprepare(mxc_rng->clk); clk_disable_unprepare(mxc_rng->clk);
out: out:
......
...@@ -119,11 +119,6 @@ static int omap_rng_probe(struct platform_device *pdev) ...@@ -119,11 +119,6 @@ static int omap_rng_probe(struct platform_device *pdev)
dev_set_drvdata(&pdev->dev, priv); dev_set_drvdata(&pdev->dev, priv);
priv->mem_res = platform_get_resource(pdev, IORESOURCE_MEM, 0); priv->mem_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!priv->mem_res) {
ret = -ENOENT;
goto err_ioremap;
}
priv->base = devm_ioremap_resource(&pdev->dev, priv->mem_res); priv->base = devm_ioremap_resource(&pdev->dev, priv->mem_res);
if (IS_ERR(priv->base)) { if (IS_ERR(priv->base)) {
ret = PTR_ERR(priv->base); ret = PTR_ERR(priv->base);
......
...@@ -1273,11 +1273,6 @@ static int tegra_dma_probe(struct platform_device *pdev) ...@@ -1273,11 +1273,6 @@ static int tegra_dma_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, tdma); platform_set_drvdata(pdev, tdma);
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res) {
dev_err(&pdev->dev, "No mem resource for DMA\n");
return -EINVAL;
}
tdma->base_addr = devm_ioremap_resource(&pdev->dev, res); tdma->base_addr = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(tdma->base_addr)) if (IS_ERR(tdma->base_addr))
return PTR_ERR(tdma->base_addr); return PTR_ERR(tdma->base_addr);
......
...@@ -619,11 +619,6 @@ static int mvebu_gpio_probe(struct platform_device *pdev) ...@@ -619,11 +619,6 @@ static int mvebu_gpio_probe(struct platform_device *pdev)
* per-CPU registers */ * per-CPU registers */
if (soc_variant == MVEBU_GPIO_SOC_VARIANT_ARMADAXP) { if (soc_variant == MVEBU_GPIO_SOC_VARIANT_ARMADAXP) {
res = platform_get_resource(pdev, IORESOURCE_MEM, 1); res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
if (!res) {
dev_err(&pdev->dev, "Cannot get memory resource\n");
return -ENODEV;
}
mvchip->percpu_membase = devm_ioremap_resource(&pdev->dev, mvchip->percpu_membase = devm_ioremap_resource(&pdev->dev,
res); res);
if (IS_ERR(mvchip->percpu_membase)) if (IS_ERR(mvchip->percpu_membase))
......
...@@ -463,11 +463,6 @@ static int tegra_gpio_probe(struct platform_device *pdev) ...@@ -463,11 +463,6 @@ static int tegra_gpio_probe(struct platform_device *pdev)
} }
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res) {
dev_err(&pdev->dev, "Missing MEM resource\n");
return -ENODEV;
}
regs = devm_ioremap_resource(&pdev->dev, res); regs = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(regs)) if (IS_ERR(regs))
return PTR_ERR(regs); return PTR_ERR(regs);
......
...@@ -2005,11 +2005,6 @@ static int hdmi_probe(struct platform_device *pdev) ...@@ -2005,11 +2005,6 @@ static int hdmi_probe(struct platform_device *pdev)
} }
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res) {
DRM_ERROR("failed to find registers\n");
return -ENOENT;
}
hdata->regs = devm_ioremap_resource(&pdev->dev, res); hdata->regs = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(hdata->regs)) if (IS_ERR(hdata->regs))
return PTR_ERR(hdata->regs); return PTR_ERR(hdata->regs);
......
...@@ -1128,11 +1128,6 @@ static int tegra_dc_probe(struct platform_device *pdev) ...@@ -1128,11 +1128,6 @@ static int tegra_dc_probe(struct platform_device *pdev)
return err; return err;
regs = platform_get_resource(pdev, IORESOURCE_MEM, 0); regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!regs) {
dev_err(&pdev->dev, "failed to get registers\n");
return -ENXIO;
}
dc->regs = devm_ioremap_resource(&pdev->dev, regs); dc->regs = devm_ioremap_resource(&pdev->dev, regs);
if (IS_ERR(dc->regs)) if (IS_ERR(dc->regs))
return PTR_ERR(dc->regs); return PTR_ERR(dc->regs);
......
...@@ -1082,11 +1082,6 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev) ...@@ -1082,11 +1082,6 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev)
/* map the registers */ /* map the registers */
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (res == NULL) {
dev_err(&pdev->dev, "cannot find IO resource\n");
return -ENOENT;
}
i2c->regs = devm_ioremap_resource(&pdev->dev, res); i2c->regs = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(i2c->regs)) if (IS_ERR(i2c->regs))
......
...@@ -303,12 +303,6 @@ static int i2c_sirfsoc_probe(struct platform_device *pdev) ...@@ -303,12 +303,6 @@ static int i2c_sirfsoc_probe(struct platform_device *pdev)
adap->class = I2C_CLASS_HWMON; adap->class = I2C_CLASS_HWMON;
mem_res = platform_get_resource(pdev, IORESOURCE_MEM, 0); mem_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (mem_res == NULL) {
dev_err(&pdev->dev, "Unable to get MEM resource\n");
err = -EINVAL;
goto out;
}
siic->base = devm_ioremap_resource(&pdev->dev, mem_res); siic->base = devm_ioremap_resource(&pdev->dev, mem_res);
if (IS_ERR(siic->base)) { if (IS_ERR(siic->base)) {
err = PTR_ERR(siic->base); err = PTR_ERR(siic->base);
......
...@@ -714,11 +714,6 @@ static int tegra_i2c_probe(struct platform_device *pdev) ...@@ -714,11 +714,6 @@ static int tegra_i2c_probe(struct platform_device *pdev)
int ret = 0; int ret = 0;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res) {
dev_err(&pdev->dev, "no mem resource\n");
return -EINVAL;
}
base = devm_ioremap_resource(&pdev->dev, res); base = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(base)) if (IS_ERR(base))
return PTR_ERR(base); return PTR_ERR(base);
......
...@@ -1560,12 +1560,6 @@ static int __init_or_module emif_probe(struct platform_device *pdev) ...@@ -1560,12 +1560,6 @@ static int __init_or_module emif_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, emif); platform_set_drvdata(pdev, emif);
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res) {
dev_err(emif->dev, "%s: error getting memory resource\n",
__func__);
goto error;
}
emif->base = devm_ioremap_resource(emif->dev, res); emif->base = devm_ioremap_resource(emif->dev, res);
if (IS_ERR(emif->base)) if (IS_ERR(emif->base))
goto error; goto error;
......
...@@ -414,11 +414,6 @@ static int intel_msic_probe(struct platform_device *pdev) ...@@ -414,11 +414,6 @@ static int intel_msic_probe(struct platform_device *pdev)
* the clients via intel_msic_irq_read(). * the clients via intel_msic_irq_read().
*/ */
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res) {
dev_err(&pdev->dev, "failed to get SRAM iomem resource\n");
return -ENODEV;
}
msic->irq_base = devm_ioremap_resource(&pdev->dev, res); msic->irq_base = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(msic->irq_base)) if (IS_ERR(msic->irq_base))
return PTR_ERR(msic->irq_base); return PTR_ERR(msic->irq_base);
......
...@@ -154,11 +154,6 @@ static int ssc_probe(struct platform_device *pdev) ...@@ -154,11 +154,6 @@ static int ssc_probe(struct platform_device *pdev)
ssc->pdata = (struct atmel_ssc_platform_data *)plat_dat; ssc->pdata = (struct atmel_ssc_platform_data *)plat_dat;
regs = platform_get_resource(pdev, IORESOURCE_MEM, 0); regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!regs) {
dev_dbg(&pdev->dev, "no mmio resource defined\n");
return -ENXIO;
}
ssc->regs = devm_ioremap_resource(&pdev->dev, regs); ssc->regs = devm_ioremap_resource(&pdev->dev, regs);
if (IS_ERR(ssc->regs)) if (IS_ERR(ssc->regs))
return PTR_ERR(ssc->regs); return PTR_ERR(ssc->regs);
......
...@@ -672,11 +672,6 @@ static int lpc32xx_nand_probe(struct platform_device *pdev) ...@@ -672,11 +672,6 @@ static int lpc32xx_nand_probe(struct platform_device *pdev)
} }
rc = platform_get_resource(pdev, IORESOURCE_MEM, 0); rc = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (rc == NULL) {
dev_err(&pdev->dev, "No memory resource found for device!\r\n");
return -ENXIO;
}
host->io_base = devm_ioremap_resource(&pdev->dev, rc); host->io_base = devm_ioremap_resource(&pdev->dev, rc);
if (IS_ERR(host->io_base)) if (IS_ERR(host->io_base))
return PTR_ERR(host->io_base); return PTR_ERR(host->io_base);
......
...@@ -2745,11 +2745,6 @@ static int sh_eth_drv_probe(struct platform_device *pdev) ...@@ -2745,11 +2745,6 @@ static int sh_eth_drv_probe(struct platform_device *pdev)
if (mdp->cd->tsu) { if (mdp->cd->tsu) {
struct resource *rtsu; struct resource *rtsu;
rtsu = platform_get_resource(pdev, IORESOURCE_MEM, 1); rtsu = platform_get_resource(pdev, IORESOURCE_MEM, 1);
if (!rtsu) {
dev_err(&pdev->dev, "Not found TSU resource\n");
ret = -ENODEV;
goto out_release;
}
mdp->tsu_addr = devm_ioremap_resource(&pdev->dev, rtsu); mdp->tsu_addr = devm_ioremap_resource(&pdev->dev, rtsu);
if (IS_ERR(mdp->tsu_addr)) { if (IS_ERR(mdp->tsu_addr)) {
ret = PTR_ERR(mdp->tsu_addr); ret = PTR_ERR(mdp->tsu_addr);
......
...@@ -713,11 +713,6 @@ static int __init u300_gpio_probe(struct platform_device *pdev) ...@@ -713,11 +713,6 @@ static int __init u300_gpio_probe(struct platform_device *pdev)
gpio->dev = &pdev->dev; gpio->dev = &pdev->dev;
memres = platform_get_resource(pdev, IORESOURCE_MEM, 0); memres = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!memres) {
dev_err(gpio->dev, "could not get GPIO memory resource\n");
return -ENODEV;
}
gpio->base = devm_ioremap_resource(&pdev->dev, memres); gpio->base = devm_ioremap_resource(&pdev->dev, memres);
if (IS_ERR(gpio->base)) if (IS_ERR(gpio->base))
return PTR_ERR(gpio->base); return PTR_ERR(gpio->base);
......
...@@ -1000,11 +1000,6 @@ static int exynos5440_pinctrl_probe(struct platform_device *pdev) ...@@ -1000,11 +1000,6 @@ static int exynos5440_pinctrl_probe(struct platform_device *pdev)
} }
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res) {
dev_err(dev, "cannot find IO resource\n");
return -ENOENT;
}
priv->reg_base = devm_ioremap_resource(&pdev->dev, res); priv->reg_base = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(priv->reg_base)) if (IS_ERR(priv->reg_base))
return PTR_ERR(priv->reg_base); return PTR_ERR(priv->reg_base);
......
...@@ -932,11 +932,6 @@ static int samsung_pinctrl_probe(struct platform_device *pdev) ...@@ -932,11 +932,6 @@ static int samsung_pinctrl_probe(struct platform_device *pdev)
drvdata->dev = dev; drvdata->dev = dev;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res) {
dev_err(dev, "cannot find IO resource\n");
return -ENOENT;
}
drvdata->virt_base = devm_ioremap_resource(&pdev->dev, res); drvdata->virt_base = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(drvdata->virt_base)) if (IS_ERR(drvdata->virt_base))
return PTR_ERR(drvdata->virt_base); return PTR_ERR(drvdata->virt_base);
......
...@@ -716,10 +716,6 @@ static int pinmux_xway_probe(struct platform_device *pdev) ...@@ -716,10 +716,6 @@ static int pinmux_xway_probe(struct platform_device *pdev)
/* get and remap our register range */ /* get and remap our register range */
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res) {
dev_err(&pdev->dev, "Failed to get resource\n");
return -ENOENT;
}
xway_info.membase[0] = devm_ioremap_resource(&pdev->dev, res); xway_info.membase[0] = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(xway_info.membase[0])) if (IS_ERR(xway_info.membase[0]))
return PTR_ERR(xway_info.membase[0]); return PTR_ERR(xway_info.membase[0]);
......
...@@ -265,11 +265,6 @@ static int imx_pwm_probe(struct platform_device *pdev) ...@@ -265,11 +265,6 @@ static int imx_pwm_probe(struct platform_device *pdev)
imx->chip.npwm = 1; imx->chip.npwm = 1;
r = platform_get_resource(pdev, IORESOURCE_MEM, 0); r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (r == NULL) {
dev_err(&pdev->dev, "no memory resource defined\n");
return -ENODEV;
}
imx->mmio_base = devm_ioremap_resource(&pdev->dev, r); imx->mmio_base = devm_ioremap_resource(&pdev->dev, r);
if (IS_ERR(imx->mmio_base)) if (IS_ERR(imx->mmio_base))
return PTR_ERR(imx->mmio_base); return PTR_ERR(imx->mmio_base);
......
...@@ -117,11 +117,6 @@ static int pwm_probe(struct platform_device *pdev) ...@@ -117,11 +117,6 @@ static int pwm_probe(struct platform_device *pdev)
return PTR_ERR(puv3->clk); return PTR_ERR(puv3->clk);
r = platform_get_resource(pdev, IORESOURCE_MEM, 0); r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (r == NULL) {
dev_err(&pdev->dev, "no memory resource defined\n");
return -ENODEV;
}
puv3->base = devm_ioremap_resource(&pdev->dev, r); puv3->base = devm_ioremap_resource(&pdev->dev, r);
if (IS_ERR(puv3->base)) if (IS_ERR(puv3->base))
return PTR_ERR(puv3->base); return PTR_ERR(puv3->base);
......
...@@ -147,11 +147,6 @@ static int pwm_probe(struct platform_device *pdev) ...@@ -147,11 +147,6 @@ static int pwm_probe(struct platform_device *pdev)
pwm->chip.npwm = (id->driver_data & HAS_SECONDARY_PWM) ? 2 : 1; pwm->chip.npwm = (id->driver_data & HAS_SECONDARY_PWM) ? 2 : 1;
r = platform_get_resource(pdev, IORESOURCE_MEM, 0); r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (r == NULL) {
dev_err(&pdev->dev, "no memory resource defined\n");
return -ENODEV;
}
pwm->mmio_base = devm_ioremap_resource(&pdev->dev, r); pwm->mmio_base = devm_ioremap_resource(&pdev->dev, r);
if (IS_ERR(pwm->mmio_base)) if (IS_ERR(pwm->mmio_base))
return PTR_ERR(pwm->mmio_base); return PTR_ERR(pwm->mmio_base);
......
...@@ -181,11 +181,6 @@ static int tegra_pwm_probe(struct platform_device *pdev) ...@@ -181,11 +181,6 @@ static int tegra_pwm_probe(struct platform_device *pdev)
pwm->dev = &pdev->dev; pwm->dev = &pdev->dev;
r = platform_get_resource(pdev, IORESOURCE_MEM, 0); r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!r) {
dev_err(&pdev->dev, "no memory resources defined\n");
return -ENODEV;
}
pwm->mmio_base = devm_ioremap_resource(&pdev->dev, r); pwm->mmio_base = devm_ioremap_resource(&pdev->dev, r);
if (IS_ERR(pwm->mmio_base)) if (IS_ERR(pwm->mmio_base))
return PTR_ERR(pwm->mmio_base); return PTR_ERR(pwm->mmio_base);
......
...@@ -240,11 +240,6 @@ static int ecap_pwm_probe(struct platform_device *pdev) ...@@ -240,11 +240,6 @@ static int ecap_pwm_probe(struct platform_device *pdev)
pc->chip.npwm = 1; pc->chip.npwm = 1;
r = platform_get_resource(pdev, IORESOURCE_MEM, 0); r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!r) {
dev_err(&pdev->dev, "no memory resource defined\n");
return -ENODEV;
}
pc->mmio_base = devm_ioremap_resource(&pdev->dev, r); pc->mmio_base = devm_ioremap_resource(&pdev->dev, r);
if (IS_ERR(pc->mmio_base)) if (IS_ERR(pc->mmio_base))
return PTR_ERR(pc->mmio_base); return PTR_ERR(pc->mmio_base);
......
...@@ -471,11 +471,6 @@ static int ehrpwm_pwm_probe(struct platform_device *pdev) ...@@ -471,11 +471,6 @@ static int ehrpwm_pwm_probe(struct platform_device *pdev)
pc->chip.npwm = NUM_PWM_CHANNEL; pc->chip.npwm = NUM_PWM_CHANNEL;
r = platform_get_resource(pdev, IORESOURCE_MEM, 0); r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!r) {
dev_err(&pdev->dev, "no memory resource defined\n");
return -ENODEV;
}
pc->mmio_base = devm_ioremap_resource(&pdev->dev, r); pc->mmio_base = devm_ioremap_resource(&pdev->dev, r);
if (IS_ERR(pc->mmio_base)) if (IS_ERR(pc->mmio_base))
return PTR_ERR(pc->mmio_base); return PTR_ERR(pc->mmio_base);
......
...@@ -70,11 +70,6 @@ static int pwmss_probe(struct platform_device *pdev) ...@@ -70,11 +70,6 @@ static int pwmss_probe(struct platform_device *pdev)
mutex_init(&info->pwmss_lock); mutex_init(&info->pwmss_lock);
r = platform_get_resource(pdev, IORESOURCE_MEM, 0); r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!r) {
dev_err(&pdev->dev, "no memory resource defined\n");
return -ENODEV;
}
info->mmio_base = devm_ioremap_resource(&pdev->dev, r); info->mmio_base = devm_ioremap_resource(&pdev->dev, r);
if (IS_ERR(info->mmio_base)) if (IS_ERR(info->mmio_base))
return PTR_ERR(info->mmio_base); return PTR_ERR(info->mmio_base);
......
...@@ -230,11 +230,6 @@ static int vt8500_pwm_probe(struct platform_device *pdev) ...@@ -230,11 +230,6 @@ static int vt8500_pwm_probe(struct platform_device *pdev)
} }
r = platform_get_resource(pdev, IORESOURCE_MEM, 0); r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (r == NULL) {
dev_err(&pdev->dev, "no memory resource defined\n");
return -ENODEV;
}
chip->base = devm_ioremap_resource(&pdev->dev, r); chip->base = devm_ioremap_resource(&pdev->dev, r);
if (IS_ERR(chip->base)) if (IS_ERR(chip->base))
return PTR_ERR(chip->base); return PTR_ERR(chip->base);
......
...@@ -234,11 +234,6 @@ static int __init nuc900_rtc_probe(struct platform_device *pdev) ...@@ -234,11 +234,6 @@ static int __init nuc900_rtc_probe(struct platform_device *pdev)
return -ENOMEM; return -ENOMEM;
} }
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res) {
dev_err(&pdev->dev, "platform_get_resource failed\n");
return -ENXIO;
}
nuc900_rtc->rtc_reg = devm_ioremap_resource(&pdev->dev, res); nuc900_rtc->rtc_reg = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(nuc900_rtc->rtc_reg)) if (IS_ERR(nuc900_rtc->rtc_reg))
return PTR_ERR(nuc900_rtc->rtc_reg); return PTR_ERR(nuc900_rtc->rtc_reg);
......
...@@ -347,11 +347,6 @@ static int __init omap_rtc_probe(struct platform_device *pdev) ...@@ -347,11 +347,6 @@ static int __init omap_rtc_probe(struct platform_device *pdev)
} }
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res) {
pr_debug("%s: RTC resource data missing\n", pdev->name);
return -ENOENT;
}
rtc_base = devm_ioremap_resource(&pdev->dev, res); rtc_base = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(rtc_base)) if (IS_ERR(rtc_base))
return PTR_ERR(rtc_base); return PTR_ERR(rtc_base);
......
...@@ -477,11 +477,6 @@ static int s3c_rtc_probe(struct platform_device *pdev) ...@@ -477,11 +477,6 @@ static int s3c_rtc_probe(struct platform_device *pdev)
/* get the memory region */ /* get the memory region */
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (res == NULL) {
dev_err(&pdev->dev, "failed to get memory region resource\n");
return -ENOENT;
}
s3c_rtc_base = devm_ioremap_resource(&pdev->dev, res); s3c_rtc_base = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(s3c_rtc_base)) if (IS_ERR(s3c_rtc_base))
return PTR_ERR(s3c_rtc_base); return PTR_ERR(s3c_rtc_base);
......
...@@ -322,12 +322,6 @@ static int __init tegra_rtc_probe(struct platform_device *pdev) ...@@ -322,12 +322,6 @@ static int __init tegra_rtc_probe(struct platform_device *pdev)
return -ENOMEM; return -ENOMEM;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res) {
dev_err(&pdev->dev,
"Unable to allocate resources for device.\n");
return -EBUSY;
}
info->rtc_base = devm_ioremap_resource(&pdev->dev, res); info->rtc_base = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(info->rtc_base)) if (IS_ERR(info->rtc_base))
return PTR_ERR(info->rtc_base); return PTR_ERR(info->rtc_base);
......
...@@ -489,11 +489,6 @@ static int tegra_sflash_probe(struct platform_device *pdev) ...@@ -489,11 +489,6 @@ static int tegra_sflash_probe(struct platform_device *pdev)
tegra_sflash_parse_dt(tsd); tegra_sflash_parse_dt(tsd);
r = platform_get_resource(pdev, IORESOURCE_MEM, 0); r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!r) {
dev_err(&pdev->dev, "No IO memory resource\n");
ret = -ENODEV;
goto exit_free_master;
}
tsd->base = devm_ioremap_resource(&pdev->dev, r); tsd->base = devm_ioremap_resource(&pdev->dev, r);
if (IS_ERR(tsd->base)) { if (IS_ERR(tsd->base)) {
ret = PTR_ERR(tsd->base); ret = PTR_ERR(tsd->base);
......
...@@ -102,11 +102,6 @@ static int dwc2_driver_probe(struct platform_device *dev) ...@@ -102,11 +102,6 @@ static int dwc2_driver_probe(struct platform_device *dev)
} }
res = platform_get_resource(dev, IORESOURCE_MEM, 0); res = platform_get_resource(dev, IORESOURCE_MEM, 0);
if (!res) {
dev_err(&dev->dev, "missing memory base resource\n");
return -EINVAL;
}
hsotg->regs = devm_ioremap_resource(&dev->dev, res); hsotg->regs = devm_ioremap_resource(&dev->dev, res);
if (IS_ERR(hsotg->regs)) if (IS_ERR(hsotg->regs))
return PTR_ERR(hsotg->regs); return PTR_ERR(hsotg->regs);
......
...@@ -800,11 +800,6 @@ static int tegra_nvec_probe(struct platform_device *pdev) ...@@ -800,11 +800,6 @@ static int tegra_nvec_probe(struct platform_device *pdev)
} }
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res) {
dev_err(&pdev->dev, "no mem resource?\n");
return -ENODEV;
}
base = devm_ioremap_resource(&pdev->dev, res); base = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(base)) if (IS_ERR(base))
return PTR_ERR(base); return PTR_ERR(base);
......
...@@ -169,21 +169,11 @@ static int armada_thermal_probe(struct platform_device *pdev) ...@@ -169,21 +169,11 @@ static int armada_thermal_probe(struct platform_device *pdev)
return -ENOMEM; return -ENOMEM;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res) {
dev_err(&pdev->dev, "Failed to get platform resource\n");
return -ENODEV;
}
priv->sensor = devm_ioremap_resource(&pdev->dev, res); priv->sensor = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(priv->sensor)) if (IS_ERR(priv->sensor))
return PTR_ERR(priv->sensor); return PTR_ERR(priv->sensor);
res = platform_get_resource(pdev, IORESOURCE_MEM, 1); res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
if (!res) {
dev_err(&pdev->dev, "Failed to get platform resource\n");
return -ENODEV;
}
priv->control = devm_ioremap_resource(&pdev->dev, res); priv->control = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(priv->control)) if (IS_ERR(priv->control))
return PTR_ERR(priv->control); return PTR_ERR(priv->control);
......
...@@ -149,10 +149,6 @@ static int dove_thermal_probe(struct platform_device *pdev) ...@@ -149,10 +149,6 @@ static int dove_thermal_probe(struct platform_device *pdev)
return PTR_ERR(priv->sensor); return PTR_ERR(priv->sensor);
res = platform_get_resource(pdev, IORESOURCE_MEM, 1); res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
if (!res) {
dev_err(&pdev->dev, "Failed to get platform resource\n");
return -ENODEV;
}
priv->control = devm_ioremap_resource(&pdev->dev, res); priv->control = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(priv->control)) if (IS_ERR(priv->control))
return PTR_ERR(priv->control); return PTR_ERR(priv->control);
......
...@@ -925,11 +925,6 @@ static int exynos_tmu_probe(struct platform_device *pdev) ...@@ -925,11 +925,6 @@ static int exynos_tmu_probe(struct platform_device *pdev)
INIT_WORK(&data->irq_work, exynos_tmu_work); INIT_WORK(&data->irq_work, exynos_tmu_work);
data->mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); data->mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!data->mem) {
dev_err(&pdev->dev, "Failed to get platform resource\n");
return -ENOENT;
}
data->base = devm_ioremap_resource(&pdev->dev, data->mem); data->base = devm_ioremap_resource(&pdev->dev, data->mem);
if (IS_ERR(data->base)) if (IS_ERR(data->base))
return PTR_ERR(data->base); return PTR_ERR(data->base);
......
...@@ -370,11 +370,6 @@ static int ci_hdrc_probe(struct platform_device *pdev) ...@@ -370,11 +370,6 @@ static int ci_hdrc_probe(struct platform_device *pdev)
} }
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res) {
dev_err(dev, "missing resource\n");
return -ENODEV;
}
base = devm_ioremap_resource(dev, res); base = devm_ioremap_resource(dev, res);
if (IS_ERR(base)) if (IS_ERR(base))
return PTR_ERR(base); return PTR_ERR(base);
......
...@@ -2334,21 +2334,11 @@ static int bcm63xx_udc_probe(struct platform_device *pdev) ...@@ -2334,21 +2334,11 @@ static int bcm63xx_udc_probe(struct platform_device *pdev)
} }
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res) {
dev_err(dev, "error finding USBD resource\n");
return -ENXIO;
}
udc->usbd_regs = devm_ioremap_resource(dev, res); udc->usbd_regs = devm_ioremap_resource(dev, res);
if (IS_ERR(udc->usbd_regs)) if (IS_ERR(udc->usbd_regs))
return PTR_ERR(udc->usbd_regs); return PTR_ERR(udc->usbd_regs);
res = platform_get_resource(pdev, IORESOURCE_MEM, 1); res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
if (!res) {
dev_err(dev, "error finding IUDMA resource\n");
return -ENXIO;
}
udc->iudma_regs = devm_ioremap_resource(dev, res); udc->iudma_regs = devm_ioremap_resource(dev, res);
if (IS_ERR(udc->iudma_regs)) if (IS_ERR(udc->iudma_regs))
return PTR_ERR(udc->iudma_regs); return PTR_ERR(udc->iudma_regs);
......
...@@ -300,12 +300,6 @@ static int usb_hcd_nxp_probe(struct platform_device *pdev) ...@@ -300,12 +300,6 @@ static int usb_hcd_nxp_probe(struct platform_device *pdev)
} }
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res) {
dev_err(&pdev->dev, "Failed to get MEM resource\n");
ret = -ENOMEM;
goto out8;
}
hcd->regs = devm_ioremap_resource(&pdev->dev, res); hcd->regs = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(hcd->regs)) { if (IS_ERR(hcd->regs)) {
ret = PTR_ERR(hcd->regs); ret = PTR_ERR(hcd->regs);
......
...@@ -278,11 +278,6 @@ static int mv_u3d_phy_probe(struct platform_device *pdev) ...@@ -278,11 +278,6 @@ static int mv_u3d_phy_probe(struct platform_device *pdev)
} }
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res) {
dev_err(dev, "missing mem resource\n");
return -ENODEV;
}
phy_base = devm_ioremap_resource(dev, res); phy_base = devm_ioremap_resource(dev, res);
if (IS_ERR(phy_base)) if (IS_ERR(phy_base))
return PTR_ERR(phy_base); return PTR_ERR(phy_base);
......
...@@ -130,11 +130,6 @@ static int mxs_phy_probe(struct platform_device *pdev) ...@@ -130,11 +130,6 @@ static int mxs_phy_probe(struct platform_device *pdev)
int ret; int ret;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res) {
dev_err(&pdev->dev, "can't get device resources\n");
return -ENOENT;
}
base = devm_ioremap_resource(&pdev->dev, res); base = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(base)) if (IS_ERR(base))
return PTR_ERR(base); return PTR_ERR(base);
......
...@@ -363,11 +363,6 @@ static int samsung_usb2phy_probe(struct platform_device *pdev) ...@@ -363,11 +363,6 @@ static int samsung_usb2phy_probe(struct platform_device *pdev)
int ret; int ret;
phy_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); phy_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!phy_mem) {
dev_err(dev, "%s: missing mem resource\n", __func__);
return -ENODEV;
}
phy_base = devm_ioremap_resource(dev, phy_mem); phy_base = devm_ioremap_resource(dev, phy_mem);
if (IS_ERR(phy_base)) if (IS_ERR(phy_base))
return PTR_ERR(phy_base); return PTR_ERR(phy_base);
......
...@@ -239,11 +239,6 @@ static int samsung_usb3phy_probe(struct platform_device *pdev) ...@@ -239,11 +239,6 @@ static int samsung_usb3phy_probe(struct platform_device *pdev)
int ret; int ret;
phy_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); phy_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!phy_mem) {
dev_err(dev, "%s: missing mem resource\n", __func__);
return -ENODEV;
}
phy_base = devm_ioremap_resource(dev, phy_mem); phy_base = devm_ioremap_resource(dev, phy_mem);
if (IS_ERR(phy_base)) if (IS_ERR(phy_base))
return PTR_ERR(phy_base); return PTR_ERR(phy_base);
......
...@@ -1065,10 +1065,6 @@ static int omapdss_hdmihw_probe(struct platform_device *pdev) ...@@ -1065,10 +1065,6 @@ static int omapdss_hdmihw_probe(struct platform_device *pdev)
mutex_init(&hdmi.ip_data.lock); mutex_init(&hdmi.ip_data.lock);
res = platform_get_resource(hdmi.pdev, IORESOURCE_MEM, 0); res = platform_get_resource(hdmi.pdev, IORESOURCE_MEM, 0);
if (!res) {
DSSERR("can't get IORESOURCE_MEM HDMI\n");
return -EINVAL;
}
/* Base address taken from platform */ /* Base address taken from platform */
hdmi.ip_data.base_wp = devm_ioremap_resource(&pdev->dev, res); hdmi.ip_data.base_wp = devm_ioremap_resource(&pdev->dev, res);
......
...@@ -353,11 +353,6 @@ static int __init vrfb_probe(struct platform_device *pdev) ...@@ -353,11 +353,6 @@ static int __init vrfb_probe(struct platform_device *pdev)
/* first resource is the register res, the rest are vrfb contexts */ /* first resource is the register res, the rest are vrfb contexts */
mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!mem) {
dev_err(&pdev->dev, "can't get vrfb base address\n");
return -EINVAL;
}
vrfb_base = devm_ioremap_resource(&pdev->dev, mem); vrfb_base = devm_ioremap_resource(&pdev->dev, mem);
if (IS_ERR(vrfb_base)) if (IS_ERR(vrfb_base))
return PTR_ERR(vrfb_base); return PTR_ERR(vrfb_base);
......
...@@ -555,11 +555,6 @@ static int omap_hdq_probe(struct platform_device *pdev) ...@@ -555,11 +555,6 @@ static int omap_hdq_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, hdq_data); platform_set_drvdata(pdev, hdq_data);
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res) {
dev_dbg(&pdev->dev, "unable to get resource\n");
return -ENXIO;
}
hdq_data->hdq_base = devm_ioremap_resource(dev, res); hdq_data->hdq_base = devm_ioremap_resource(dev, res);
if (IS_ERR(hdq_data->hdq_base)) if (IS_ERR(hdq_data->hdq_base))
return PTR_ERR(hdq_data->hdq_base); return PTR_ERR(hdq_data->hdq_base);
......
...@@ -248,11 +248,6 @@ static int ath79_wdt_probe(struct platform_device *pdev) ...@@ -248,11 +248,6 @@ static int ath79_wdt_probe(struct platform_device *pdev)
return -EBUSY; return -EBUSY;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res) {
dev_err(&pdev->dev, "no memory resource found\n");
return -EINVAL;
}
wdt_base = devm_ioremap_resource(&pdev->dev, res); wdt_base = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(wdt_base)) if (IS_ERR(wdt_base))
return PTR_ERR(wdt_base); return PTR_ERR(wdt_base);
......
...@@ -217,11 +217,6 @@ static int davinci_wdt_probe(struct platform_device *pdev) ...@@ -217,11 +217,6 @@ static int davinci_wdt_probe(struct platform_device *pdev)
dev_info(dev, "heartbeat %d sec\n", heartbeat); dev_info(dev, "heartbeat %d sec\n", heartbeat);
wdt_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); wdt_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (wdt_mem == NULL) {
dev_err(dev, "failed to get memory region resource\n");
return -ENOENT;
}
wdt_base = devm_ioremap_resource(dev, wdt_mem); wdt_base = devm_ioremap_resource(dev, wdt_mem);
if (IS_ERR(wdt_base)) if (IS_ERR(wdt_base))
return PTR_ERR(wdt_base); return PTR_ERR(wdt_base);
......
...@@ -257,11 +257,6 @@ static int __init imx2_wdt_probe(struct platform_device *pdev) ...@@ -257,11 +257,6 @@ static int __init imx2_wdt_probe(struct platform_device *pdev)
struct resource *res; struct resource *res;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res) {
dev_err(&pdev->dev, "can't get device resources\n");
return -ENODEV;
}
imx2_wdt.base = devm_ioremap_resource(&pdev->dev, res); imx2_wdt.base = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(imx2_wdt.base)) if (IS_ERR(imx2_wdt.base))
return PTR_ERR(imx2_wdt.base); return PTR_ERR(imx2_wdt.base);
......
...@@ -540,11 +540,6 @@ static int imx_ssi_probe(struct platform_device *pdev) ...@@ -540,11 +540,6 @@ static int imx_ssi_probe(struct platform_device *pdev)
clk_prepare_enable(ssi->clk); clk_prepare_enable(ssi->clk);
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res) {
ret = -ENODEV;
goto failed_get_resource;
}
ssi->base = devm_ioremap_resource(&pdev->dev, res); ssi->base = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(ssi->base)) { if (IS_ERR(ssi->base)) {
ret = PTR_ERR(ssi->base); ret = PTR_ERR(ssi->base);
...@@ -633,7 +628,6 @@ static int imx_ssi_probe(struct platform_device *pdev) ...@@ -633,7 +628,6 @@ static int imx_ssi_probe(struct platform_device *pdev)
snd_soc_unregister_component(&pdev->dev); snd_soc_unregister_component(&pdev->dev);
failed_register: failed_register:
release_mem_region(res->start, resource_size(res)); release_mem_region(res->start, resource_size(res));
failed_get_resource:
clk_disable_unprepare(ssi->clk); clk_disable_unprepare(ssi->clk);
failed_clk: failed_clk:
......
...@@ -471,11 +471,6 @@ static int kirkwood_i2s_dev_probe(struct platform_device *pdev) ...@@ -471,11 +471,6 @@ static int kirkwood_i2s_dev_probe(struct platform_device *pdev)
dev_set_drvdata(&pdev->dev, priv); dev_set_drvdata(&pdev->dev, priv);
mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!mem) {
dev_err(&pdev->dev, "platform_get_resource failed\n");
return -ENXIO;
}
priv->io = devm_ioremap_resource(&pdev->dev, mem); priv->io = devm_ioremap_resource(&pdev->dev, mem);
if (IS_ERR(priv->io)) if (IS_ERR(priv->io))
return PTR_ERR(priv->io); return PTR_ERR(priv->io);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment