Skip to content

Commit 0d0f8b2

Browse files
Uwe Kleine-Königrafaeljw
authored andcommitted
thermal: da9062: 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 aa59965 commit 0d0f8b2

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

drivers/thermal/da9062-thermal.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -239,19 +239,18 @@ static int da9062_thermal_probe(struct platform_device *pdev)
239239
return ret;
240240
}
241241

242-
static int da9062_thermal_remove(struct platform_device *pdev)
242+
static void da9062_thermal_remove(struct platform_device *pdev)
243243
{
244244
struct da9062_thermal *thermal = platform_get_drvdata(pdev);
245245

246246
free_irq(thermal->irq, thermal);
247247
cancel_delayed_work_sync(&thermal->work);
248248
thermal_zone_device_unregister(thermal->zone);
249-
return 0;
250249
}
251250

252251
static struct platform_driver da9062_thermal_driver = {
253252
.probe = da9062_thermal_probe,
254-
.remove = da9062_thermal_remove,
253+
.remove_new = da9062_thermal_remove,
255254
.driver = {
256255
.name = "da9062-thermal",
257256
.of_match_table = da9062_compatible_reg_id_table,

0 commit comments

Comments
 (0)