Skip to content

Commit 9a7897a

Browse files
Uwe Kleine-Königrafaeljw
authored andcommitted
ACPI: TAD: 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: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 0cc46f1 commit 9a7897a

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/acpi/acpi_tad.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ static int acpi_tad_disable_timer(struct device *dev, u32 timer_id)
554554
return acpi_tad_wake_set(dev, "_STV", timer_id, ACPI_TAD_WAKE_DISABLED);
555555
}
556556

557-
static int acpi_tad_remove(struct platform_device *pdev)
557+
static void acpi_tad_remove(struct platform_device *pdev)
558558
{
559559
struct device *dev = &pdev->dev;
560560
acpi_handle handle = ACPI_HANDLE(dev);
@@ -579,7 +579,6 @@ static int acpi_tad_remove(struct platform_device *pdev)
579579
pm_runtime_put_sync(dev);
580580
pm_runtime_disable(dev);
581581
acpi_remove_cmos_rtc_space_handler(handle);
582-
return 0;
583582
}
584583

585584
static int acpi_tad_probe(struct platform_device *pdev)
@@ -684,7 +683,7 @@ static struct platform_driver acpi_tad_driver = {
684683
.acpi_match_table = acpi_tad_ids,
685684
},
686685
.probe = acpi_tad_probe,
687-
.remove = acpi_tad_remove,
686+
.remove_new = acpi_tad_remove,
688687
};
689688
MODULE_DEVICE_TABLE(acpi, acpi_tad_ids);
690689

0 commit comments

Comments
 (0)