Skip to content

Commit 75b66d7

Browse files
Uwe Kleine-Königrafaeljw
authored andcommitted
thermal: int3400: 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> Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 02e7baa commit 75b66d7

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

drivers/thermal/intel/int340x_thermal/int3400_thermal.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,7 @@ static int int3400_thermal_probe(struct platform_device *pdev)
674674
return result;
675675
}
676676

677-
static int int3400_thermal_remove(struct platform_device *pdev)
677+
static void int3400_thermal_remove(struct platform_device *pdev)
678678
{
679679
struct int3400_thermal_priv *priv = platform_get_drvdata(pdev);
680680

@@ -698,7 +698,6 @@ static int int3400_thermal_remove(struct platform_device *pdev)
698698
kfree(priv->trts);
699699
kfree(priv->arts);
700700
kfree(priv);
701-
return 0;
702701
}
703702

704703
static const struct acpi_device_id int3400_thermal_match[] = {
@@ -714,7 +713,7 @@ MODULE_DEVICE_TABLE(acpi, int3400_thermal_match);
714713

715714
static struct platform_driver int3400_thermal_driver = {
716715
.probe = int3400_thermal_probe,
717-
.remove = int3400_thermal_remove,
716+
.remove_new = int3400_thermal_remove,
718717
.driver = {
719718
.name = "int3400 thermal",
720719
.acpi_match_table = ACPI_PTR(int3400_thermal_match),

0 commit comments

Comments
 (0)