summaryrefslogtreecommitdiffstats
path: root/drivers/iio
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@linaro.org>2024-09-16 16:09:15 +0200
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2024-09-30 10:20:54 +0200
commit50161b2768d0f5381e095c04a3048fba9e19900e (patch)
tree8a4d214807bf8e7267237770ce33419d30c2d6c2 /drivers/iio
parentiio: bmi323: fix copy and paste bugs in suspend resume (diff)
downloadlinux-50161b2768d0f5381e095c04a3048fba9e19900e.tar.xz
linux-50161b2768d0f5381e095c04a3048fba9e19900e.zip
iio: bmi323: fix reversed if statement in bmi323_core_runtime_resume()
This reversed if statement means that the function just returns success without writing to the registers. Fixes: 16531118ba63 ("iio: bmi323: peripheral in lowest power state on suspend") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Link: https://patch.msgid.link/689a2122-6e2f-4b0c-9a1c-39a98621c6c1@stanley.mountain Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio')
-rw-r--r--drivers/iio/imu/bmi323/bmi323_core.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/iio/imu/bmi323/bmi323_core.c b/drivers/iio/imu/bmi323/bmi323_core.c
index c953501c2a75..4bd8af01376b 100644
--- a/drivers/iio/imu/bmi323/bmi323_core.c
+++ b/drivers/iio/imu/bmi323/bmi323_core.c
@@ -2231,8 +2231,10 @@ static int bmi323_core_runtime_resume(struct device *dev)
* after being reset in the lower power state by runtime-pm.
*/
ret = bmi323_init(data);
- if (!ret)
+ if (ret) {
+ dev_err(data->dev, "Device power-on and init failed: %d", ret);
return ret;
+ }
/* Register must be cleared before changing an active config */
ret = regmap_write(data->regmap, BMI323_FEAT_IO0_REG, 0);