diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2021-10-25 22:50:07 +0300 |
---|---|---|
committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2021-11-17 20:51:31 +0300 |
commit | e12653eb77b90fc33ff3e0b9caf21b02b026f552 (patch) | |
tree | 51d08ffa53a5ef9cf72a7d0db0fe14ac3d9af111 /drivers/iio/accel | |
parent | 8eebe6281ac1062764db23d181e3feb3305a3690 (diff) | |
download | linux-e12653eb77b90fc33ff3e0b9caf21b02b026f552.tar.xz |
iio: accel: mma7660: Warn about failure to put device in stand-by in .remove()
Whan an i2c 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 <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20211025195007.84541-1-u.kleine-koenig@pengutronix.de
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/accel')
-rw-r--r-- | drivers/iio/accel/mma7660.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/iio/accel/mma7660.c b/drivers/iio/accel/mma7660.c index cd6cdf2c51b0..24b83ccdb950 100644 --- a/drivers/iio/accel/mma7660.c +++ b/drivers/iio/accel/mma7660.c @@ -210,10 +210,16 @@ static int mma7660_probe(struct i2c_client *client, static int mma7660_remove(struct i2c_client *client) { struct iio_dev *indio_dev = i2c_get_clientdata(client); + int ret; iio_device_unregister(indio_dev); - return mma7660_set_mode(iio_priv(indio_dev), MMA7660_MODE_STANDBY); + ret = mma7660_set_mode(iio_priv(indio_dev), MMA7660_MODE_STANDBY); + if (ret) + dev_warn(&client->dev, "Failed to put device in stand-by mode (%pe), ignoring\n", + ERR_PTR(ret)); + + return 0; } #ifdef CONFIG_PM_SLEEP |