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

pwm: tiecap: Simplify using devm_pwmchip_add()

With devm_pwmchip_add() there is no need to explicitly call
pwmchip_remove(), so this call can be dropped from the remove callback.

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
a64a5853 8614e210

+2 -4
+2 -4
drivers/pwm/pwm-tiecap.c
··· 253 253 if (IS_ERR(pc->mmio_base)) 254 254 return PTR_ERR(pc->mmio_base); 255 255 256 - ret = pwmchip_add(&pc->chip); 256 + ret = devm_pwmchip_add(&pdev->dev, &pc->chip); 257 257 if (ret < 0) { 258 258 dev_err(&pdev->dev, "pwmchip_add() failed: %d\n", ret); 259 259 return ret; ··· 267 267 268 268 static int ecap_pwm_remove(struct platform_device *pdev) 269 269 { 270 - struct ecap_pwm_chip *pc = platform_get_drvdata(pdev); 271 - 272 270 pm_runtime_disable(&pdev->dev); 273 271 274 - return pwmchip_remove(&pc->chip); 272 + return 0; 275 273 } 276 274 277 275 #ifdef CONFIG_PM_SLEEP