Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

platform/x86: intel: int1092: intel_sar: 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 (mostly) ignored
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.

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>
Link: https://lore.kernel.org/r/20230302144732.1903781-21-u.kleine-koenig@pengutronix.de
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>

authored by

Uwe Kleine-König and committed by
Hans de Goede
e709455e 445f79fd

+2 -3
+2 -3
drivers/platform/x86/intel/int1092/intel_sar.c
··· 292 292 return result; 293 293 } 294 294 295 - static int sar_remove(struct platform_device *device) 295 + static void sar_remove(struct platform_device *device) 296 296 { 297 297 struct wwan_sar_context *context = dev_get_drvdata(&device->dev); 298 298 int reg; ··· 304 304 kfree(context->config_data[reg].device_mode_info); 305 305 306 306 kfree(context); 307 - return 0; 308 307 } 309 308 310 309 static struct platform_driver sar_driver = { 311 310 .probe = sar_probe, 312 - .remove = sar_remove, 311 + .remove_new = sar_remove, 313 312 .driver = { 314 313 .name = DRVNAME, 315 314 .acpi_match_table = ACPI_PTR(sar_device_ids)