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

platform/x86: intel: int0002_vgpio: 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-20-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
445f79fd 63b89016

+2 -3
+2 -3
drivers/platform/x86/intel/int0002_vgpio.c
··· 223 223 return 0; 224 224 } 225 225 226 - static int int0002_remove(struct platform_device *pdev) 226 + static void int0002_remove(struct platform_device *pdev) 227 227 { 228 228 device_init_wakeup(&pdev->dev, false); 229 229 acpi_unregister_wakeup_handler(int0002_check_wake, NULL); 230 - return 0; 231 230 } 232 231 233 232 static int int0002_suspend(struct device *dev) ··· 272 273 .pm = &int0002_pm_ops, 273 274 }, 274 275 .probe = int0002_probe, 275 - .remove = int0002_remove, 276 + .remove_new = int0002_remove, 276 277 }; 277 278 278 279 module_platform_driver(int0002_driver);