pwm: ntxec: 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
43f5f48d09
commit
9c3fac7aaf
@ -150,22 +150,12 @@ static int ntxec_pwm_probe(struct platform_device *pdev)
|
|||||||
priv->ec = ec;
|
priv->ec = ec;
|
||||||
priv->dev = &pdev->dev;
|
priv->dev = &pdev->dev;
|
||||||
|
|
||||||
platform_set_drvdata(pdev, priv);
|
|
||||||
|
|
||||||
chip = &priv->chip;
|
chip = &priv->chip;
|
||||||
chip->dev = &pdev->dev;
|
chip->dev = &pdev->dev;
|
||||||
chip->ops = &ntxec_pwm_ops;
|
chip->ops = &ntxec_pwm_ops;
|
||||||
chip->npwm = 1;
|
chip->npwm = 1;
|
||||||
|
|
||||||
return pwmchip_add(chip);
|
return devm_pwmchip_add(&pdev->dev, chip);
|
||||||
}
|
|
||||||
|
|
||||||
static int ntxec_pwm_remove(struct platform_device *pdev)
|
|
||||||
{
|
|
||||||
struct ntxec_pwm *priv = platform_get_drvdata(pdev);
|
|
||||||
struct pwm_chip *chip = &priv->chip;
|
|
||||||
|
|
||||||
return pwmchip_remove(chip);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct platform_driver ntxec_pwm_driver = {
|
static struct platform_driver ntxec_pwm_driver = {
|
||||||
@ -173,7 +163,6 @@ static struct platform_driver ntxec_pwm_driver = {
|
|||||||
.name = "ntxec-pwm",
|
.name = "ntxec-pwm",
|
||||||
},
|
},
|
||||||
.probe = ntxec_pwm_probe,
|
.probe = ntxec_pwm_probe,
|
||||||
.remove = ntxec_pwm_remove,
|
|
||||||
};
|
};
|
||||||
module_platform_driver(ntxec_pwm_driver);
|
module_platform_driver(ntxec_pwm_driver);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user