iio: gyro: mpu3050: Fix the error handling in mpu3050_power_up()
Subsystems (2)
PATCH 1/1 iio: gyro: mpu3050: Fix the error handling in mpu3050_power_up()
The driver should disable regulators when fails at regmap_update_bits().
Signed-off-by Zheyu Ma <[email protected]>
--- drivers/iio/gyro/mpu3050-core.c | 1 + 1 file changed, 1 insertion(+)
drivers/iio/gyro/mpu3050-core.c +1 -0
@@ -875,6 +875,7 @@ static int mpu3050_power_up(struct mpu3050 *mpu3050) ret =regmap_update_bits (mpu3050->map,MPU3050_PWR_MGM ,MPU3050_PWR_MGM_SLEEP ,0 );if (ret) { +regulator_bulk_disable (ARRAY_SIZE (mpu3050->regs), mpu3050->regs);dev_err (mpu3050->dev,"error setting power mode\n" );return ret; }
Signature · 1 line
2.25.1
Quoted 3 lines · Zheyu Ma
The driver should disable regulators when fails at
regmap_update_bits().Signed-off-by Zheyu Ma <[email protected]>
Looks correct!
Reviewed-by Linus Walleij <[email protected]>
Yours.
Linus Walleij
Quoted 8 lines · On Fri, 13 May 2022 00:08:37 +0200 Linus Walleij <[email protected]>…
Quoted 3 lines · Zheyu Ma
The driver should disable regulators when fails at
regmap_update_bits().Signed-off-by Zheyu Ma <[email protected]>Looks correct!
Reviewed-by Linus Walleij <[email protected]>
I'm not going to rush this one in as
Applied to the fixes-togreg branch of iio.git and marked for stable (I was a bit borderline in deciding on stable marking but meh, it's safe enough as fixes go and real issue, even if one we are unlikely to hit)
Thanks,
Jonathan
Quoted 3 lines
Yours.
Linus Walleij