From: Uwe Kleine-König Date: Wed, 13 Oct 2021 20:32:19 +0000 (+0200) Subject: iio: health: afe4403: Don't return an error in .remove() X-Git-Tag: v5.16-rc1~119^2~23^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c7143c49c6041da1739765055645337e082abeb4;p=thirdparty%2Flinux.git iio: health: afe4403: 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 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 Reviewed-by: Alexandru Ardelean Link: https://lore.kernel.org/r/20211013203223.2694577-12-u.kleine-koenig@pengutronix.de Signed-off-by: Jonathan Cameron --- diff --git a/drivers/iio/health/afe4403.c b/drivers/iio/health/afe4403.c index e89185544d0f8..97b82f9a8e458 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; }