Commit f7edeb40 authored by Uwe Kleine-König's avatar Uwe Kleine-König Committed by Thierry Reding

pwm: imx1: Simplify using devm_pwmchip_add()

With devm_pwmchip_add() we can drop pwmchip_remove() from the device
remove callback. The latter can then go away, too and as this is the
only user of platform_get_drvdata(), the respective call to
platform_set_drvdata() can go, too.
Signed-off-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: default avatarThierry Reding <thierry.reding@gmail.com>
parent 1bc6ea31
...@@ -141,8 +141,6 @@ static int pwm_imx1_probe(struct platform_device *pdev) ...@@ -141,8 +141,6 @@ static int pwm_imx1_probe(struct platform_device *pdev)
if (!imx) if (!imx)
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),
...@@ -161,14 +159,7 @@ static int pwm_imx1_probe(struct platform_device *pdev) ...@@ -161,14 +159,7 @@ static int pwm_imx1_probe(struct platform_device *pdev)
if (IS_ERR(imx->mmio_base)) if (IS_ERR(imx->mmio_base))
return PTR_ERR(imx->mmio_base); return PTR_ERR(imx->mmio_base);
return pwmchip_add(&imx->chip); return devm_pwmchip_add(&pdev->dev, &imx->chip);
}
static int pwm_imx1_remove(struct platform_device *pdev)
{
struct pwm_imx1_chip *imx = platform_get_drvdata(pdev);
return pwmchip_remove(&imx->chip);
} }
static struct platform_driver pwm_imx1_driver = { static struct platform_driver pwm_imx1_driver = {
...@@ -177,7 +168,6 @@ static struct platform_driver pwm_imx1_driver = { ...@@ -177,7 +168,6 @@ static struct platform_driver pwm_imx1_driver = {
.of_match_table = pwm_imx1_dt_ids, .of_match_table = pwm_imx1_dt_ids,
}, },
.probe = pwm_imx1_probe, .probe = pwm_imx1_probe,
.remove = pwm_imx1_remove,
}; };
module_platform_driver(pwm_imx1_driver); module_platform_driver(pwm_imx1_driver);
......
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