Skip to content

Commit 74550b0

Browse files
Uwe Kleine-Königrafaeljw
authored andcommitted
ACPI: pfr_update: 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 b4a48c5 commit 74550b0

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/acpi/pfr_update.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -489,13 +489,11 @@ static const struct file_operations acpi_pfru_fops = {
489489
.llseek = noop_llseek,
490490
};
491491

492-
static int acpi_pfru_remove(struct platform_device *pdev)
492+
static void acpi_pfru_remove(struct platform_device *pdev)
493493
{
494494
struct pfru_device *pfru_dev = platform_get_drvdata(pdev);
495495

496496
misc_deregister(&pfru_dev->miscdev);
497-
498-
return 0;
499497
}
500498

501499
static void pfru_put_idx(void *data)
@@ -567,7 +565,7 @@ static struct platform_driver acpi_pfru_driver = {
567565
.acpi_match_table = acpi_pfru_ids,
568566
},
569567
.probe = acpi_pfru_probe,
570-
.remove = acpi_pfru_remove,
568+
.remove_new = acpi_pfru_remove,
571569
};
572570
module_platform_driver(acpi_pfru_driver);
573571

0 commit comments

Comments
 (0)