media: ov2680: Fix regulators being left enabled on ov2680_power_on() errors
authorHans de Goede <hdegoede@redhat.com>
Thu, 3 Aug 2023 09:33:23 +0000 (11:33 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Sep 2023 07:42:55 +0000 (09:42 +0200)
commit86a41ad0128abd1014b4c30d0efd3b0bb5726bd4
tree93c1222e1dd392f50100e5c3d995fb9ffe04e0f3
parent85fb0b963f2b58701be7699f299924f3006ac132
media: ov2680: Fix regulators being left enabled on ov2680_power_on() errors

[ Upstream commit 84b4bd7e0d98166aa32fd470e672721190492eae ]

When the ov2680_power_on() "sensor soft reset failed" path is hit during
probe() the WARN() about putting an enabled regulator at
drivers/regulator/core.c:2398 triggers 3 times (once for each regulator),
filling dmesg with backtraces.

Fix this by properly disabling the regulators on ov2680_power_on() errors.

Fixes: 3ee47cad3e69 ("media: ov2680: Add Omnivision OV2680 sensor driver")
Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com>
Acked-by: Rui Miguel Silva <rmfrfs@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/media/i2c/ov2680.c