Commit 362e9cd2 authored by Wolfram Sang's avatar Wolfram Sang

drivers/pwm: don't check resource with devm_ioremap_resource

devm_ioremap_resource does sanity checks on the given resource. No need to
duplicate this in the driver.
Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
Acked-by: default avatarStephen Warren <swarren@nvidia.com>
parent 0497a594
...@@ -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);
......
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