mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
pwm: sl28cpld: 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
b7783c6258
commit
02dd2e417e
1 changed files with 1 additions and 11 deletions
|
@ -231,9 +231,7 @@ static int sl28cpld_pwm_probe(struct platform_device *pdev)
|
||||||
chip->ops = &sl28cpld_pwm_ops;
|
chip->ops = &sl28cpld_pwm_ops;
|
||||||
chip->npwm = 1;
|
chip->npwm = 1;
|
||||||
|
|
||||||
platform_set_drvdata(pdev, priv);
|
ret = devm_pwmchip_add(&pdev->dev, &priv->pwm_chip);
|
||||||
|
|
||||||
ret = pwmchip_add(&priv->pwm_chip);
|
|
||||||
if (ret) {
|
if (ret) {
|
||||||
dev_err(&pdev->dev, "failed to add PWM chip (%pe)",
|
dev_err(&pdev->dev, "failed to add PWM chip (%pe)",
|
||||||
ERR_PTR(ret));
|
ERR_PTR(ret));
|
||||||
|
@ -243,13 +241,6 @@ static int sl28cpld_pwm_probe(struct platform_device *pdev)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int sl28cpld_pwm_remove(struct platform_device *pdev)
|
|
||||||
{
|
|
||||||
struct sl28cpld_pwm *priv = platform_get_drvdata(pdev);
|
|
||||||
|
|
||||||
return pwmchip_remove(&priv->pwm_chip);
|
|
||||||
}
|
|
||||||
|
|
||||||
static const struct of_device_id sl28cpld_pwm_of_match[] = {
|
static const struct of_device_id sl28cpld_pwm_of_match[] = {
|
||||||
{ .compatible = "kontron,sl28cpld-pwm" },
|
{ .compatible = "kontron,sl28cpld-pwm" },
|
||||||
{}
|
{}
|
||||||
|
@ -258,7 +249,6 @@ MODULE_DEVICE_TABLE(of, sl28cpld_pwm_of_match);
|
||||||
|
|
||||||
static struct platform_driver sl28cpld_pwm_driver = {
|
static struct platform_driver sl28cpld_pwm_driver = {
|
||||||
.probe = sl28cpld_pwm_probe,
|
.probe = sl28cpld_pwm_probe,
|
||||||
.remove = sl28cpld_pwm_remove,
|
|
||||||
.driver = {
|
.driver = {
|
||||||
.name = "sl28cpld-pwm",
|
.name = "sl28cpld-pwm",
|
||||||
.of_match_table = sl28cpld_pwm_of_match,
|
.of_match_table = sl28cpld_pwm_of_match,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue