spi: sprd: Don't skip cleanup in remove's error path
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Tue, 7 Mar 2023 21:14:25 +0000 (22:14 +0100)
committerMark Brown <broonie@kernel.org>
Mon, 20 Mar 2023 13:11:37 +0000 (13:11 +0000)
commit5cb79889a0bab6832662ec5b8f7d1f0e6e7c25ed
tree9fc175c04cbd2cd6f201aef1d605b03b3f1107b0
parent864f0513a377184e12aa650089c9af71ba36c6e9
spi: sprd: Don't skip cleanup in remove's error path

If pm_runtime_resume_and_get() failed before this change, two error
messages were printed. One directly in sprd_spi_remove() and another
by the device core as the return value is non-zero.

The better handling of a failure to resume the device is to do the
software related cleanup anyhow and only skip hardware accesses.
This leaves the device in an unknown state, but there is nothing that can
be done about that.

Even in the error case, return zero to suppress the device core's error
message.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20230307211426.2331483-2-u.kleine-koenig@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-sprd.c