diff options
| author | Zheyu Ma <zheyuma97@gmail.com> | 2022-05-10 17:24:31 +0800 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-07-02 16:27:35 +0200 |
| commit | ac9a8a683cb928a38ef2e7f93c7396aef73fdfeb (patch) | |
| tree | 7bc5da2d53f0fe52297bfe927cbbc4a2bbd03473 /drivers | |
| parent | 123c40524ec08a07cbff861f9efdac4ee2e919af (diff) | |
| download | linux-ac9a8a683cb928a38ef2e7f93c7396aef73fdfeb.tar.gz linux-ac9a8a683cb928a38ef2e7f93c7396aef73fdfeb.tar.bz2 linux-ac9a8a683cb928a38ef2e7f93c7396aef73fdfeb.zip | |
iio: gyro: mpu3050: Fix the error handling in mpu3050_power_up()
commit b2f5ad97645e1deb5ca9bcb7090084b92cae35d2 upstream.
The driver should disable regulators when fails at regmap_update_bits().
Signed-off-by: Zheyu Ma <zheyuma97@gmail.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Cc: <Stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20220510092431.1711284-1-zheyuma97@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/iio/gyro/mpu3050-core.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/iio/gyro/mpu3050-core.c b/drivers/iio/gyro/mpu3050-core.c index e6fdd0f4b4bc..0d7581a6f5ba 100644 --- a/drivers/iio/gyro/mpu3050-core.c +++ b/drivers/iio/gyro/mpu3050-core.c @@ -873,6 +873,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; } |
