mirror of
https://github.com/torvalds/linux.git
synced 2025-11-02 17:49:03 +02:00
pwm: imx27: Simplify using devm_pwmchip_add()
This allows to drop the platform_driver's remove function. This is the only user of driver data so this can go away, too. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
This commit is contained in:
parent
5ba3eb4bb3
commit
acfdc2030a
1 changed files with 1 additions and 13 deletions
|
|
@ -313,8 +313,6 @@ static int pwm_imx27_probe(struct platform_device *pdev)
|
||||||
if (imx == NULL)
|
if (imx == NULL)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
platform_set_drvdata(pdev, imx);
|
|
||||||
|
|
||||||
imx->clk_ipg = devm_clk_get(&pdev->dev, "ipg");
|
imx->clk_ipg = devm_clk_get(&pdev->dev, "ipg");
|
||||||
if (IS_ERR(imx->clk_ipg))
|
if (IS_ERR(imx->clk_ipg))
|
||||||
return dev_err_probe(&pdev->dev, PTR_ERR(imx->clk_ipg),
|
return dev_err_probe(&pdev->dev, PTR_ERR(imx->clk_ipg),
|
||||||
|
|
@ -342,16 +340,7 @@ static int pwm_imx27_probe(struct platform_device *pdev)
|
||||||
if (!(pwmcr & MX3_PWMCR_EN))
|
if (!(pwmcr & MX3_PWMCR_EN))
|
||||||
pwm_imx27_clk_disable_unprepare(imx);
|
pwm_imx27_clk_disable_unprepare(imx);
|
||||||
|
|
||||||
return pwmchip_add(&imx->chip);
|
return devm_pwmchip_add(&pdev->dev, &imx->chip);
|
||||||
}
|
|
||||||
|
|
||||||
static int pwm_imx27_remove(struct platform_device *pdev)
|
|
||||||
{
|
|
||||||
struct pwm_imx27_chip *imx;
|
|
||||||
|
|
||||||
imx = platform_get_drvdata(pdev);
|
|
||||||
|
|
||||||
return pwmchip_remove(&imx->chip);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct platform_driver imx_pwm_driver = {
|
static struct platform_driver imx_pwm_driver = {
|
||||||
|
|
@ -360,7 +349,6 @@ static struct platform_driver imx_pwm_driver = {
|
||||||
.of_match_table = pwm_imx27_dt_ids,
|
.of_match_table = pwm_imx27_dt_ids,
|
||||||
},
|
},
|
||||||
.probe = pwm_imx27_probe,
|
.probe = pwm_imx27_probe,
|
||||||
.remove = pwm_imx27_remove,
|
|
||||||
};
|
};
|
||||||
module_platform_driver(imx_pwm_driver);
|
module_platform_driver(imx_pwm_driver);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue