提交 8a52740d 编写于 作者: Z Zheyu Ma 提交者: Zheng Zengkai

iio: gyro: mpu3050: Fix the error handling in mpu3050_power_up()

stable inclusion
from stable-v5.10.127
commit 399788e819a17c43f275516b375b4314b6827191
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I5XDDK

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=399788e819a17c43f275516b375b4314b6827191

--------------------------------

commit b2f5ad97 upstream.

The driver should disable regulators when fails at regmap_update_bits().
Signed-off-by: NZheyu Ma <zheyuma97@gmail.com>
Reviewed-by: NLinus Walleij <linus.walleij@linaro.org>
Cc: <Stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20220510092431.1711284-1-zheyuma97@gmail.comSigned-off-by: NJonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Reviewed-by: NWei Li <liwei391@huawei.com>
上级 6cacb03c
......@@ -872,6 +872,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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册