Linux IIO development
 help / color / mirror / Atom feed
* [PATCH] iio: gyro: mpu3050: Fix the error handling in mpu3050_power_up()
@ 2022-05-10  9:24 Zheyu Ma
  2022-05-12 22:08 ` Linus Walleij
  0 siblings, 1 reply; 3+ messages in thread
From: Zheyu Ma @ 2022-05-10  9:24 UTC (permalink / raw)
  To: linus.walleij, jic23, lars; +Cc: linux-iio, Zheyu Ma

The driver should disable regulators when fails at regmap_update_bits().

Signed-off-by: Zheyu Ma <zheyuma97@gmail.com>
---
 drivers/iio/gyro/mpu3050-core.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/iio/gyro/mpu3050-core.c b/drivers/iio/gyro/mpu3050-core.c
index 4f19dc7ffe57..5908a96ca8af 100644
--- a/drivers/iio/gyro/mpu3050-core.c
+++ b/drivers/iio/gyro/mpu3050-core.c
@@ -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;
 	}
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-05-14 15:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-05-10  9:24 [PATCH] iio: gyro: mpu3050: Fix the error handling in mpu3050_power_up() Zheyu Ma
2022-05-12 22:08 ` Linus Walleij
2022-05-14 15:58   ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox