]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
iio: bmi323: fix reversed if statement in bmi323_core_runtime_resume()
authorDan Carpenter <dan.carpenter@linaro.org>
Mon, 16 Sep 2024 14:09:15 +0000 (17:09 +0300)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 30 Sep 2024 08:20:54 +0000 (09:20 +0100)
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>
drivers/iio/imu/bmi323/bmi323_core.c

index c953501c2a755922c58f237fe0911c1a9bd565a6..4bd8af01376b04afc9d344c07e51878219a22bd0 100644 (file)
@@ -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);