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

pwm: pca9685: Don't check the return code of pwmchip_remove()

pwmchip_remove() returns always 0. Don't use the value to make it
possible to eventually change the function to return void. Also the
driver core ignores the return value of pca9685_pwm_remove()
and considers the device removed anyhow. So returning early results
in a resource leak.

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
f0e96e2e faaa2222

+1 -4
+1 -4
drivers/pwm/pwm-pca9685.c
··· 601 601 static int pca9685_pwm_remove(struct i2c_client *client) 602 602 { 603 603 struct pca9685 *pca = i2c_get_clientdata(client); 604 - int ret; 605 604 606 - ret = pwmchip_remove(&pca->chip); 607 - if (ret) 608 - return ret; 605 + pwmchip_remove(&pca->chip); 609 606 610 607 if (!pm_runtime_enabled(&client->dev)) { 611 608 /* Put chip in sleep state if runtime PM is disabled */