]> git.baikalelectronics.ru Git - kernel.git/commit
iio:imu:bmi160: disable regulator in error path
authorTong Zhang <ztong0001@gmail.com>
Sun, 27 Mar 2022 15:40:05 +0000 (08:40 -0700)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 4 Apr 2022 08:19:01 +0000 (09:19 +0100)
commit396c964be873dde834d7e7a26613d3466b4ca15e
treeef5cd111f7a38acd8b69906aa9c4047dbdbdb140
parentc8faad47768f09437df40cbae65a2ed4d731ff3d
iio:imu:bmi160: disable regulator in error path

Regulator should be disabled in error path as mentioned in _regulator_put().
Also disable accel if gyro cannot be enabled.

[   16.233604] WARNING: CPU: 0 PID: 2177 at drivers/regulator/core.c:2257 _regulator_put
[   16.240453] Call Trace:
[   16.240572]  <TASK>
[   16.240676]  regulator_put+0x26/0x40
[   16.240853]  regulator_bulk_free+0x26/0x50
[   16.241050]  release_nodes+0x3f/0x70
[   16.241225]  devres_release_group+0x147/0x1c0
[   16.241441]  ? bmi160_core_probe+0x175/0x3a0 [bmi160_core]

Fixes: b62707872c82 ("iio: imu: bmi160: added regulator support")
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Tong Zhang <ztong0001@gmail.com>
Link: https://lore.kernel.org/r/20220327154005.806049-1-ztong0001@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/imu/bmi160/bmi160_core.c