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

platform/x86: intel: int3472: discrete: 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-22-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
6ee08b4e e709455e

+2 -4
+2 -4
drivers/platform/x86/intel/int3472/discrete.c
··· 317 317 return 0; 318 318 } 319 319 320 - static int skl_int3472_discrete_remove(struct platform_device *pdev) 320 + static void skl_int3472_discrete_remove(struct platform_device *pdev) 321 321 { 322 322 struct int3472_discrete_device *int3472 = platform_get_drvdata(pdev); 323 323 ··· 326 326 skl_int3472_unregister_clock(int3472); 327 327 skl_int3472_unregister_pled(int3472); 328 328 skl_int3472_unregister_regulator(int3472); 329 - 330 - return 0; 331 329 } 332 330 333 331 static int skl_int3472_discrete_probe(struct platform_device *pdev) ··· 390 392 .acpi_match_table = int3472_device_id, 391 393 }, 392 394 .probe = skl_int3472_discrete_probe, 393 - .remove = skl_int3472_discrete_remove, 395 + .remove_new = skl_int3472_discrete_remove, 394 396 }; 395 397 module_platform_driver(int3472_discrete); 396 398