Skip to content

Commit c516380

Browse files
Uwe Kleine-Königthierryreding
authored andcommitted
pwm: sprd: Convert to platform remove callback returning void
The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
1 parent f113c11 commit c516380

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

drivers/pwm/pwm-sprd.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -280,13 +280,11 @@ static int sprd_pwm_probe(struct platform_device *pdev)
280280
return ret;
281281
}
282282

283-
static int sprd_pwm_remove(struct platform_device *pdev)
283+
static void sprd_pwm_remove(struct platform_device *pdev)
284284
{
285285
struct sprd_pwm_chip *spc = platform_get_drvdata(pdev);
286286

287287
pwmchip_remove(&spc->chip);
288-
289-
return 0;
290288
}
291289

292290
static const struct of_device_id sprd_pwm_of_match[] = {
@@ -301,7 +299,7 @@ static struct platform_driver sprd_pwm_driver = {
301299
.of_match_table = sprd_pwm_of_match,
302300
},
303301
.probe = sprd_pwm_probe,
304-
.remove = sprd_pwm_remove,
302+
.remove_new = sprd_pwm_remove,
305303
};
306304

307305
module_platform_driver(sprd_pwm_driver);

0 commit comments

Comments
 (0)