Skip to content

Commit 26dd487

Browse files
Uwe Kleine-Könighdeller
authored andcommitted
parisc: led: 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 ignored (apart from emitting a warning) 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. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). 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: Helge Deller <deller@gmx.de>
1 parent 0568b6f commit 26dd487

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/parisc/led.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -308,15 +308,13 @@ static int hppa_led_generic_probe(struct platform_device *pdev,
308308
return 0;
309309
}
310310

311-
static int platform_led_remove(struct platform_device *pdev)
311+
static void platform_led_remove(struct platform_device *pdev)
312312
{
313313
struct hppa_drvdata *p = platform_get_drvdata(pdev);
314314
int i;
315315

316316
for (i = 0; i < NUM_LEDS_PER_BOARD; i++)
317317
led_classdev_unregister(&p->leds[i].led_cdev);
318-
319-
return 0;
320318
}
321319

322320
static struct led_type mainboard_led_types[NUM_LEDS_PER_BOARD] = {
@@ -371,7 +369,7 @@ MODULE_ALIAS("platform:platform-leds");
371369

372370
static struct platform_driver hppa_mainboard_led_driver = {
373371
.probe = platform_led_probe,
374-
.remove = platform_led_remove,
372+
.remove_new = platform_led_remove,
375373
.driver = {
376374
.name = "platform-leds",
377375
},

0 commit comments

Comments
 (0)