From: Uwe Kleine-König Date: Wed, 7 Jul 2021 16:28:32 +0000 (+0200) Subject: pwm: samsung: Don't check the return code of pwmchip_remove() X-Git-Tag: v5.15-rc1~23^2~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4e334973541de4d31c20be22d6198c646f58eb81;p=thirdparty%2Fkernel%2Flinux.git pwm: samsung: 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 pwm_samsung_remove() and considers the device removed anyhow. So returning early results in a resource leak. Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding --- diff --git a/drivers/pwm/pwm-samsung.c b/drivers/pwm/pwm-samsung.c index f6c528f02d43f..dd94c4312a0c5 100644 --- a/drivers/pwm/pwm-samsung.c +++ b/drivers/pwm/pwm-samsung.c @@ -580,11 +580,8 @@ static int pwm_samsung_probe(struct platform_device *pdev) static int pwm_samsung_remove(struct platform_device *pdev) { struct samsung_pwm_chip *chip = platform_get_drvdata(pdev); - int ret; - ret = pwmchip_remove(&chip->chip); - if (ret < 0) - return ret; + pwmchip_remove(&chip->chip); clk_disable_unprepare(chip->base_clk);