pwm: Convert to devm_ioremap_resource()
Convert all uses of devm_request_and_ioremap() to the newly introduced devm_ioremap_resource() which provides more consistent error handling. Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Родитель
9e0c1fb29a
Коммит
6d4294d163
|
@ -274,9 +274,9 @@ static int imx_pwm_probe(struct platform_device *pdev)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
||||||
imx->mmio_base = devm_request_and_ioremap(&pdev->dev, r);
|
imx->mmio_base = devm_ioremap_resource(&pdev->dev, r);
|
||||||
if (imx->mmio_base == NULL)
|
if (IS_ERR(imx->mmio_base))
|
||||||
return -EADDRNOTAVAIL;
|
return PTR_ERR(imx->mmio_base);
|
||||||
|
|
||||||
data = of_id->data;
|
data = of_id->data;
|
||||||
imx->config = data->config;
|
imx->config = data->config;
|
||||||
|
|
|
@ -110,9 +110,9 @@ static int lpc32xx_pwm_probe(struct platform_device *pdev)
|
||||||
if (!res)
|
if (!res)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
lpc32xx->base = devm_request_and_ioremap(&pdev->dev, res);
|
lpc32xx->base = devm_ioremap_resource(&pdev->dev, res);
|
||||||
if (!lpc32xx->base)
|
if (IS_ERR(lpc32xx->base))
|
||||||
return -EADDRNOTAVAIL;
|
return PTR_ERR(lpc32xx->base);
|
||||||
|
|
||||||
lpc32xx->clk = devm_clk_get(&pdev->dev, NULL);
|
lpc32xx->clk = devm_clk_get(&pdev->dev, NULL);
|
||||||
if (IS_ERR(lpc32xx->clk))
|
if (IS_ERR(lpc32xx->clk))
|
||||||
|
|
|
@ -139,9 +139,9 @@ static int mxs_pwm_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);
|
||||||
mxs->base = devm_request_and_ioremap(&pdev->dev, res);
|
mxs->base = devm_ioremap_resource(&pdev->dev, res);
|
||||||
if (!mxs->base)
|
if (IS_ERR(mxs->base))
|
||||||
return -EADDRNOTAVAIL;
|
return PTR_ERR(mxs->base);
|
||||||
|
|
||||||
pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
|
pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
|
||||||
if (IS_ERR(pinctrl))
|
if (IS_ERR(pinctrl))
|
||||||
|
|
|
@ -123,9 +123,9 @@ static int pwm_probe(struct platform_device *pdev)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
||||||
puv3->base = devm_request_and_ioremap(&pdev->dev, r);
|
puv3->base = devm_ioremap_resource(&pdev->dev, r);
|
||||||
if (puv3->base == NULL)
|
if (IS_ERR(puv3->base))
|
||||||
return -EADDRNOTAVAIL;
|
return PTR_ERR(puv3->base);
|
||||||
|
|
||||||
puv3->chip.dev = &pdev->dev;
|
puv3->chip.dev = &pdev->dev;
|
||||||
puv3->chip.ops = &puv3_pwm_ops;
|
puv3->chip.ops = &puv3_pwm_ops;
|
||||||
|
|
|
@ -165,9 +165,9 @@ static int pwm_probe(struct platform_device *pdev)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
||||||
pwm->mmio_base = devm_request_and_ioremap(&pdev->dev, r);
|
pwm->mmio_base = devm_ioremap_resource(&pdev->dev, r);
|
||||||
if (pwm->mmio_base == NULL)
|
if (IS_ERR(pwm->mmio_base))
|
||||||
return -EADDRNOTAVAIL;
|
return PTR_ERR(pwm->mmio_base);
|
||||||
|
|
||||||
ret = pwmchip_add(&pwm->chip);
|
ret = pwmchip_add(&pwm->chip);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
|
|
|
@ -192,9 +192,9 @@ static int spear_pwm_probe(struct platform_device *pdev)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
pc->mmio_base = devm_request_and_ioremap(&pdev->dev, r);
|
pc->mmio_base = devm_ioremap_resource(&pdev->dev, r);
|
||||||
if (!pc->mmio_base)
|
if (IS_ERR(pc->mmio_base))
|
||||||
return -EADDRNOTAVAIL;
|
return PTR_ERR(pc->mmio_base);
|
||||||
|
|
||||||
pc->clk = devm_clk_get(&pdev->dev, NULL);
|
pc->clk = devm_clk_get(&pdev->dev, NULL);
|
||||||
if (IS_ERR(pc->clk))
|
if (IS_ERR(pc->clk))
|
||||||
|
|
|
@ -186,9 +186,9 @@ static int tegra_pwm_probe(struct platform_device *pdev)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
||||||
pwm->mmio_base = devm_request_and_ioremap(&pdev->dev, r);
|
pwm->mmio_base = devm_ioremap_resource(&pdev->dev, r);
|
||||||
if (!pwm->mmio_base)
|
if (IS_ERR(pwm->mmio_base))
|
||||||
return -EADDRNOTAVAIL;
|
return PTR_ERR(pwm->mmio_base);
|
||||||
|
|
||||||
platform_set_drvdata(pdev, pwm);
|
platform_set_drvdata(pdev, pwm);
|
||||||
|
|
||||||
|
|
|
@ -238,9 +238,9 @@ static int ecap_pwm_probe(struct platform_device *pdev)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
||||||
pc->mmio_base = devm_request_and_ioremap(&pdev->dev, r);
|
pc->mmio_base = devm_ioremap_resource(&pdev->dev, r);
|
||||||
if (!pc->mmio_base)
|
if (IS_ERR(pc->mmio_base))
|
||||||
return -EADDRNOTAVAIL;
|
return PTR_ERR(pc->mmio_base);
|
||||||
|
|
||||||
ret = pwmchip_add(&pc->chip);
|
ret = pwmchip_add(&pc->chip);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
|
|
|
@ -453,9 +453,9 @@ static int ehrpwm_pwm_probe(struct platform_device *pdev)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
||||||
pc->mmio_base = devm_request_and_ioremap(&pdev->dev, r);
|
pc->mmio_base = devm_ioremap_resource(&pdev->dev, r);
|
||||||
if (!pc->mmio_base)
|
if (IS_ERR(pc->mmio_base))
|
||||||
return -EADDRNOTAVAIL;
|
return PTR_ERR(pc->mmio_base);
|
||||||
|
|
||||||
/* Acquire tbclk for Time Base EHRPWM submodule */
|
/* Acquire tbclk for Time Base EHRPWM submodule */
|
||||||
pc->tbclk = devm_clk_get(&pdev->dev, "tbclk");
|
pc->tbclk = devm_clk_get(&pdev->dev, "tbclk");
|
||||||
|
|
|
@ -75,9 +75,9 @@ static int pwmss_probe(struct platform_device *pdev)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
||||||
info->mmio_base = devm_request_and_ioremap(&pdev->dev, r);
|
info->mmio_base = devm_ioremap_resource(&pdev->dev, r);
|
||||||
if (!info->mmio_base)
|
if (IS_ERR(info->mmio_base))
|
||||||
return -EADDRNOTAVAIL;
|
return PTR_ERR(info->mmio_base);
|
||||||
|
|
||||||
pm_runtime_enable(&pdev->dev);
|
pm_runtime_enable(&pdev->dev);
|
||||||
pm_runtime_get_sync(&pdev->dev);
|
pm_runtime_get_sync(&pdev->dev);
|
||||||
|
|
|
@ -178,9 +178,9 @@ static int vt8500_pwm_probe(struct platform_device *pdev)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
||||||
chip->base = devm_request_and_ioremap(&pdev->dev, r);
|
chip->base = devm_ioremap_resource(&pdev->dev, r);
|
||||||
if (!chip->base)
|
if (IS_ERR(chip->base))
|
||||||
return -EADDRNOTAVAIL;
|
return PTR_ERR(chip->base);
|
||||||
|
|
||||||
ret = clk_prepare(chip->clk);
|
ret = clk_prepare(chip->clk);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче