media: i2c: os04a10: fixed segfault for power_off

[    3.193377] ------------[ cut here ]------------
[    3.193394] WARNING: CPU: 2 PID: 1 at drivers/regulator/core.c:2159 _regulator_put+0x34/0xc8
[    3.193400] Modules linked in:
[    3.193410] CPU: 2 PID: 1 Comm: swapper/0 Tainted: G        W         5.10.110 #4
[    3.193416] Hardware name: Rockchip RK3568 EVB1 DDR4 V10 Board (DT)
[    3.193423] pstate: 80c00009 (Nzcv daif +PAN +UAO -TCO BTYPE=--)
[    3.193430] pc : _regulator_put+0x34/0xc8
[    3.193437] lr : regulator_put+0x3c/0x54
[    3.193441] sp : ffffffc011e7bad0
[    3.193446] x29: ffffffc011e7bad0 x28: 0000000000000000
[    3.193455] x27: ffffffc011490440 x26: 0000000000000000
[    3.193464] x25: ffffffc011ca2880 x24: ffffffc0112a07f6
[    3.193473] x23: ffffff8004d71700 x22: 0000000000000008
[    3.193481] x21: 0000000000000002 x20: ffffff8004d71b00
[    3.193490] x19: ffffff8004d71b00 x18: ffffff80028f5550
[    3.193500] x17: 0000000000000000 x16: 0000000000000000
[    3.193509] x15: ffffff80026b8610 x14: ffffff80028f5488
[    3.193518] x13: 0000000000000016 x12: 0000000000000018
[    3.193527] x11: 0000000000000018 x10: ffffff80026b8630
[    3.193536] x9 : ffffffc0105d7eec x8 : ffffff80026b8610
[    3.193544] x7 : ffffffc011e7b998 x6 : 0000000000000001
[    3.193553] x5 : ffffff8002718000 x4 : 0000000000000000
[    3.193562] x3 : 0000000000000000 x2 : 0000000000000000
[    3.193571] x1 : ffffff8002718000 x0 : 0000000000000001
[    3.193579] Call trace:
[    3.193587]  _regulator_put+0x34/0xc8
[    3.193593]  regulator_put+0x3c/0x54
[    3.193600]  regulator_bulk_free+0x54/0x5c
[    3.193607]  devm_regulator_bulk_release+0x28/0x34
[    3.193616]  release_nodes+0x1f4/0x224
[    3.193622]  devres_release_all+0x5c/0x60
[    3.193630]  really_probe+0x218/0x46c
[    3.193637]  driver_probe_device+0x138/0x148
[    3.193644]  device_driver_attach+0x50/0x7c
[    3.193651]  __driver_attach+0x150/0x154
[    3.193657]  bus_for_each_dev+0x7c/0xc8
[    3.193664]  driver_attach+0x30/0x3c
[    3.193670]  bus_add_driver+0x1b4/0x1fc
[    3.193676]  driver_register+0xc0/0xf8
[    3.193684]  i2c_register_driver+0x70/0xb4
[    3.193692]  sensor_mod_init+0x28/0x34
[    3.193699]  do_one_initcall+0xa0/0x1e8
[    3.193707]  kernel_init_freeable+0x2a4/0x2ac
[    3.193714]  kernel_init+0x20/0x11c

Signed-off-by: Zefa Chen <zefa.chen@rock-chips.com>
Change-Id: I7ce7fc064ddb5bbe717245f1aaf83fccafd3db02
This commit is contained in:
Zefa Chen
2022-08-03 17:05:57 +08:00
committed by Tao Huang
parent 754b4876e8
commit 9c80afd282

View File

@@ -2583,6 +2583,8 @@ static int os04a10_initialize_controls(struct os04a10 *os04a10)
os04a10->long_hcg = false;
os04a10->middle_hcg = false;
os04a10->short_hcg = false;
if (!os04a10->is_thunderboot)
os04a10->is_thunderboot_ng = true;
return 0;