Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Uwe Kleine-König and committed by
Thierry Reding
9c3fac7a 43f5f48d

+1 -12
+1 -12
drivers/pwm/pwm-ntxec.c
··· 150 150 priv->ec = ec; 151 151 priv->dev = &pdev->dev; 152 152 153 - platform_set_drvdata(pdev, priv); 154 - 155 153 chip = &priv->chip; 156 154 chip->dev = &pdev->dev; 157 155 chip->ops = &ntxec_pwm_ops; 158 156 chip->npwm = 1; 159 157 160 - return pwmchip_add(chip); 161 - } 162 - 163 - static int ntxec_pwm_remove(struct platform_device *pdev) 164 - { 165 - struct ntxec_pwm *priv = platform_get_drvdata(pdev); 166 - struct pwm_chip *chip = &priv->chip; 167 - 168 - return pwmchip_remove(chip); 158 + return devm_pwmchip_add(&pdev->dev, chip); 169 159 } 170 160 171 161 static struct platform_driver ntxec_pwm_driver = { ··· 163 173 .name = "ntxec-pwm", 164 174 }, 165 175 .probe = ntxec_pwm_probe, 166 - .remove = ntxec_pwm_remove, 167 176 }; 168 177 module_platform_driver(ntxec_pwm_driver); 169 178