media: i2c: dw9714: Disable the regulator when the driver fails to probe
authorZheyu Ma <zheyuma97@gmail.com>
Thu, 14 Apr 2022 02:34:35 +0000 (03:34 +0100)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Sun, 24 Apr 2022 07:26:18 +0000 (08:26 +0100)
commit02276e18defa2fccf16413b44440277d98c2b1ea
tree64a402b1df94143d864ef6c7f07a0f4a2164d190
parent4d19e0662fcc9e2f3bdada2c4e45dab36bd64a71
media: i2c: dw9714: Disable the regulator when the driver fails to probe

When the driver fails to probe, we will get the following splat:

[   59.305988] ------------[ cut here ]------------
[   59.306417] WARNING: CPU: 2 PID: 395 at drivers/regulator/core.c:2257 _regulator_put+0x3ec/0x4e0
[   59.310345] RIP: 0010:_regulator_put+0x3ec/0x4e0
[   59.318362] Call Trace:
[   59.318582]  <TASK>
[   59.318765]  regulator_put+0x1f/0x30
[   59.319058]  devres_release_group+0x319/0x3d0
[   59.319420]  i2c_device_probe+0x766/0x940

Fix this by disabling the regulator in error handling.

Signed-off-by: Zheyu Ma <zheyuma97@gmail.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/media/i2c/dw9714.c