Skip to content

Commit efb389b

Browse files
Uwe Kleine-Königgroeck
authored andcommitted
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]>
1 parent 2c59a32 commit efb389b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

drivers/hwmon/max31722.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,16 @@ static int max31722_probe(struct spi_device *spi)
103103
static int max31722_remove(struct spi_device *spi)
104104
{
105105
struct max31722_data *data = spi_get_drvdata(spi);
106+
int ret;
106107

107108
hwmon_device_unregister(data->hwmon_dev);
108109

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

112118
static int __maybe_unused max31722_suspend(struct device *dev)

0 commit comments

Comments
 (0)