aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUwe Kleine-König <[email protected]>2021-10-12 17:39:29 +0200
committerGuenter Roeck <[email protected]>2021-10-16 22:42:14 -0700
commitefb389b8c34fa7da673eb0a598b223bd891daa9d (patch)
tree34622a812729370bd051276e8dab38023713f125
parent2c59a32d12201b4aeaef5c0cc04698670e164dc3 (diff)
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. Acked-by: Michael Hennerich <[email protected]> Signed-off-by: Uwe Kleine-König <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]>
-rw-r--r--drivers/hwmon/max31722.c8
1 files changed, 7 insertions, 1 deletions
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)