driver core: platform: Emit a warning if a remove callback returned non-zero
authorUwe Kleine-König <uwe@kleine-koenig.org>
Sun, 7 Feb 2021 21:15:37 +0000 (22:15 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 9 Feb 2021 13:30:05 +0000 (14:30 +0100)
commite5e1c209788138f33ca6558bf9f572f6904f486d
tree3545273741bb4c9f836585d70bf209d999cf2223
parentf265f06af1948c90007c78fe9f2fa93d6cea8800
driver core: platform: Emit a warning if a remove callback returned non-zero

The driver core ignores the return value of a bus' remove callback. However
a driver returning an error code is a hint that there is a problem,
probably a driver author who expects that returning e.g. -EBUSY has any
effect.

The right thing to do would be to make struct platform_driver::remove()
return void. With the immense number of platform drivers this is however a
big quest and I hope to prevent at least a few new drivers that return an
error code here.

Signed-off-by: Uwe Kleine-König <uwe@kleine-koenig.org>
Link: https://lore.kernel.org/r/20210207211537.19992-1-uwe@kleine-koenig.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/base/platform.c