]> git.dujemihanovic.xyz Git - linux.git/commit
platform: Make platform_driver::remove() return void
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Mon, 9 Oct 2023 10:37:26 +0000 (12:37 +0200)
committerUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Mon, 27 May 2024 08:34:35 +0000 (10:34 +0200)
commit0edb555a65d1ef047a9805051c36922b52a38a9d
treee688f47b1a110e124ce61e3821101e72ae321306
parent45e7d78ef5e93520e574c05d27bcb3b69234486c
platform: Make platform_driver::remove() return void

struct platform_driver::remove returning an integer made driver authors
expect that returning an error code was proper error handling. However
the driver core ignores the error and continues to remove the device
because there is nothing the core could do anyhow and reentering the
remove callback again is only calling for trouble.

To prevent such wrong assumptions, change the return type of the remove
callback to void. This was prepared by introducing an alternative remove
callback returning void and converting all drivers to that. So .remove()
can be changed without further changes in drivers.

This corresponds to step b) of the plan outlined in commit
5c5a7680e67b ("platform: Provide a remove callback that returns no value").

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
drivers/base/platform.c
include/linux/platform_device.h