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

pwm: jz4740: 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
f0d6d7f2 2e27afd0

+1 -11
+1 -11
drivers/pwm/pwm-jz4740.c
··· 245 245 jz4740->chip.ops = &jz4740_pwm_ops; 246 246 jz4740->chip.npwm = info->num_pwms; 247 247 248 - platform_set_drvdata(pdev, jz4740); 249 - 250 - return pwmchip_add(&jz4740->chip); 251 - } 252 - 253 - static int jz4740_pwm_remove(struct platform_device *pdev) 254 - { 255 - struct jz4740_pwm_chip *jz4740 = platform_get_drvdata(pdev); 256 - 257 - return pwmchip_remove(&jz4740->chip); 248 + return devm_pwmchip_add(dev, &jz4740->chip); 258 249 } 259 250 260 251 static const struct soc_info __maybe_unused jz4740_soc_info = { ··· 271 280 .of_match_table = of_match_ptr(jz4740_pwm_dt_ids), 272 281 }, 273 282 .probe = jz4740_pwm_probe, 274 - .remove = jz4740_pwm_remove, 275 283 }; 276 284 module_platform_driver(jz4740_pwm_driver); 277 285