summaryrefslogtreecommitdiff
path: root/drivers/iio/potentiometer
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2021-10-13 22:32:22 +0200
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2021-10-19 08:30:46 +0100
commit6dcfe3fe936030e83b30f38a223d026c01d6fe88 (patch)
tree0b8905dc7cf3bf7787daeaeb7c6d2eec68a8b0d6 /drivers/iio/potentiometer
parent4b6fb9f3e98ca157ae09803731c7bd6d90519a6d (diff)
iio: potentiometer: max5487: Don't return an error in .remove()
The only effect of returning an error in an spi .remove() callback is that the spi core issues a generic warning message. Instead emit a more specific error message and return 0 to not report the same issue twice. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Reviewed-by: Alexandru Ardelean <ardeleanalex@gmail.com> Link: https://lore.kernel.org/r/20211013203223.2694577-15-u.kleine-koenig@pengutronix.de Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/potentiometer')
-rw-r--r--drivers/iio/potentiometer/max5487.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/iio/potentiometer/max5487.c b/drivers/iio/potentiometer/max5487.c
index 1c0d46a96200..007c2bd324cb 100644
--- a/drivers/iio/potentiometer/max5487.c
+++ b/drivers/iio/potentiometer/max5487.c
@@ -115,11 +115,16 @@ static int max5487_spi_probe(struct spi_device *spi)
static int max5487_spi_remove(struct spi_device *spi)
{
struct iio_dev *indio_dev = spi_get_drvdata(spi);
+ int ret;
iio_device_unregister(indio_dev);
/* save both wiper regs to NV regs */
- return max5487_write_cmd(spi, MAX5487_COPY_AB_TO_NV);
+ ret = max5487_write_cmd(spi, MAX5487_COPY_AB_TO_NV);
+ if (ret)
+ dev_warn(&spi->dev, "Failed to save wiper regs to NV regs\n");
+
+ return 0;
}
static const struct spi_device_id max5487_id[] = {