Thread (21 messages) 21 messages, 5 authors, 2021-10-12

RE: [PATCH 03/13] hwmon: max31722: Warn about failure to put device in stand-by in .remove()

From: "Hennerich, Michael" <Michael.Hennerich@analog.com>
Date: 2021-10-11 13:42:18
Also in: linux-input

-----Original Message-----
From: Uwe Kleine-König <redacted>
Sent: Montag, 11. Oktober 2021 15:28
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>; Hennerich, Michael
[off-list ref]
Cc: Mark Brown <broonie@kernel.org>; linux-spi@vger.kernel.org;
kernel@pengutronix.de; linux-input@vger.kernel.org
Subject: [PATCH 03/13] hwmon: max31722: Warn about failure to put device in
stand-by in .remove()

When an spi driver's remove function returns a non-zero error code nothing
happens apart from emitting a generic error message. Make this error message
more device specific and return zero instead.

Signed-off-by: Uwe Kleine-König <redacted>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
quoted hunk ↗ jump to hunk
---
 drivers/hwmon/max31722.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/hwmon/max31722.c b/drivers/hwmon/max31722.c index
613338cbcb17..4cf4fe6809a3 100644
--- a/drivers/hwmon/max31722.c
+++ b/drivers/hwmon/max31722.c
@@ -103,10 +103,16 @@ static int max31722_probe(struct spi_device *spi)
static int max31722_remove(struct spi_device *spi)  {
 	struct max31722_data *data = spi_get_drvdata(spi);
+	int ret;

 	hwmon_device_unregister(data->hwmon_dev);

-	return max31722_set_mode(data, MAX31722_MODE_STANDBY);
+	ret = max31722_set_mode(data, MAX31722_MODE_STANDBY);
+	if (ret)
+		/* There is nothing we can do about this ... */
+		dev_warn(&spi->dev, "Failed to put device in stand-by
mode\n");
+
+	return 0;
 }

 static int __maybe_unused max31722_suspend(struct device *dev)
--
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