media: i2c: ov7740: fix unbalanced pm_runtime_get_sync in remove

The ov7740_remove() function unconditionally called pm_runtime_get_sync()
but completely ignored the return value. If the device was already in an
error state or disconnected, this could lead to an unbalanced PM runtime
usage count or attempt to communicate with an unresponsive device.

Disable Runtime PM first, then see if the device is active, and if so,
power it off.

Signed-off-by: Biren Pandya <birenpandya@gmail.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
This commit is contained in:
Biren Pandya 2026-07-08 18:27:22 +05:30 • committed by Sakari Ailus
commit 22790c57c6