Thread (20 messages) 20 messages, 3 authors, 2021-10-14
STALE1736d LANDED

[PATCH 11/15] iio: health: afe4403: Don't return an error in .remove()

From: Uwe Kleine-König <hidden>
Date: 2021-10-13 20:32:46
Also in: linux-spi
Subsystem: iio subsystem and drivers, the rest · Maintainers: Jonathan Cameron, Linus Torvalds

The only effect of returning an error in an spi .remove() callback is
that the spi core issues another warning message. Don't report the same
problem twice and return 0 unconditionally instead. Also degrade the log
level to warning, as nothing really bad is expected from a failure to
put the device in suspend mode.

Signed-off-by: Uwe Kleine-König <redacted>
---
 drivers/iio/health/afe4403.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/iio/health/afe4403.c b/drivers/iio/health/afe4403.c
index d4921385aaf7..0c355063072c 100644
--- a/drivers/iio/health/afe4403.c
+++ b/drivers/iio/health/afe4403.c
@@ -589,10 +589,8 @@ static int afe4403_remove(struct spi_device *spi)
 		iio_trigger_unregister(afe->trig);
 
 	ret = regulator_disable(afe->regulator);
-	if (ret) {
-		dev_err(afe->dev, "Unable to disable regulator\n");
-		return ret;
-	}
+	if (ret)
+		dev_warn(afe->dev, "Unable to disable regulator\n");
 
 	return 0;
 }
-- 
2.30.2
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help