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

pwm: keembay: 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
0aa2bec5 f0d6d7f2

+1 -11
+1 -11
drivers/pwm/pwm-keembay.c
··· 207 207 priv->chip.ops = &keembay_pwm_ops; 208 208 priv->chip.npwm = KMB_TOTAL_PWM_CHANNELS; 209 209 210 - ret = pwmchip_add(&priv->chip); 210 + ret = devm_pwmchip_add(dev, &priv->chip); 211 211 if (ret) 212 212 return dev_err_probe(dev, ret, "Failed to add PWM chip\n"); 213 213 214 - platform_set_drvdata(pdev, priv); 215 - 216 214 return 0; 217 - } 218 - 219 - static int keembay_pwm_remove(struct platform_device *pdev) 220 - { 221 - struct keembay_pwm *priv = platform_get_drvdata(pdev); 222 - 223 - return pwmchip_remove(&priv->chip); 224 215 } 225 216 226 217 static const struct of_device_id keembay_pwm_of_match[] = { ··· 222 231 223 232 static struct platform_driver keembay_pwm_driver = { 224 233 .probe = keembay_pwm_probe, 225 - .remove = keembay_pwm_remove, 226 234 .driver = { 227 235 .name = "pwm-keembay", 228 236 .of_match_table = keembay_pwm_of_match,