Skip to content

Commit 91f950b

Browse files
amiclausjic23
authored andcommitted
iio: gyro: mpu3050-i2c: fix pm_runtime error handling
The return value of pm_runtime_get_sync() is not checked, and the function always returns success. This allows I2C mux operations to proceed even when the device fails to resume. Use pm_runtime_resume_and_get() and propagate its return value to properly handle resume failures. Fixes: 3904b28 ("iio: gyro: Add driver for the MPU-3050 gyroscope") Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com> Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
1 parent dd6183e commit 91f950b

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

drivers/iio/gyro/mpu3050-i2c.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ static int mpu3050_i2c_bypass_select(struct i2c_mux_core *mux, u32 chan_id)
1919
struct mpu3050 *mpu3050 = i2c_mux_priv(mux);
2020

2121
/* Just power up the device, that is all that is needed */
22-
pm_runtime_get_sync(mpu3050->dev);
23-
return 0;
22+
return pm_runtime_resume_and_get(mpu3050->dev);
2423
}
2524

2625
static int mpu3050_i2c_bypass_deselect(struct i2c_mux_core *mux, u32 chan_id)

0 commit comments

Comments
 (0)