mbox series

[0/3] spi: atmel-quadspi: Convert to platform remove callback returning void

Message ID 20230317084232.142257-1-u.kleine-koenig@pengutronix.de
Headers show
Series spi: atmel-quadspi: Convert to platform remove callback returning void | expand

Message

Uwe Kleine-König March 17, 2023, 8:42 a.m. UTC
Hello,

this series converts the atmel-quadspi driver to use the .remove_new()
callback that doesn't return an int but void. The motivation is to not
give driver authors a reason to (wrongly) believe that returning an
error code was sensible error handling. In fact the spi core only emits
a warning message in this case and otherwise continues as if the return
value was zero. This usually yields resource leaks that sometimes can
lead to exceptions later on.

The atmel-quadspi driver is one of these drivers that got error handling
wrong, this is fixed here and in the last patch the driver is converted
to .remove_new() with the eventual goal to change .remove() to return
void once all drivers are converted this way.

Best regards
Uwe

Uwe Kleine-König (3):
  spi: atmel-quadspi: Don't leak clk enable count in pm resume
  spi: atmel-quadspi: Free resources even if runtime resume failed in
    .remove()
  spi: atmel-quadspi: Convert to platform remove callback returning void

 drivers/spi/atmel-quadspi.c | 36 ++++++++++++++++++++++++------------
 1 file changed, 24 insertions(+), 12 deletions(-)


base-commit: fe15c26ee26efa11741a7b632e9f23b01aca4cc6