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

ASoC: Intel: sst: 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>
Acked-by: Takashi Iwai <tiwai@suse.de>
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Link: https://lore.kernel.org/r/20230315150745.67084-94-u.kleine-koenig@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Uwe Kleine-König and committed by
Mark Brown
c524f167 0d31e8ad

+2 -3
+2 -3
sound/soc/intel/atom/sst/sst_acpi.c
··· 335 335 * This function is called by OS when a device is unloaded 336 336 * This frees the interrupt etc 337 337 */ 338 - static int sst_acpi_remove(struct platform_device *pdev) 338 + static void sst_acpi_remove(struct platform_device *pdev) 339 339 { 340 340 struct intel_sst_drv *ctx; 341 341 342 342 ctx = platform_get_drvdata(pdev); 343 343 sst_context_cleanup(ctx); 344 344 platform_set_drvdata(pdev, NULL); 345 - return 0; 346 345 } 347 346 348 347 static const struct acpi_device_id sst_acpi_ids[] = { ··· 359 360 .pm = &intel_sst_pm, 360 361 }, 361 362 .probe = sst_acpi_probe, 362 - .remove = sst_acpi_remove, 363 + .remove_new = sst_acpi_remove, 363 364 }; 364 365 365 366 module_platform_driver(sst_acpi_driver);