]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
media: i2c: imx214: Rectify probe error handling related to runtime PM
authorSakari Ailus <sakari.ailus@linux.intel.com>
Fri, 10 Jan 2025 12:36:01 +0000 (14:36 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 20 Apr 2025 08:15:37 +0000 (10:15 +0200)
commit6f77a6d2ea31dd8a0a59ba4f7eb0cd1b2ca4599a
treeb401d11043acfa6e3ab6f911851aa2bf7affaf22
parent8dd2d1561c6a42213ad2e118cef805ec81c544b1
media: i2c: imx214: Rectify probe error handling related to runtime PM

commit ccc888d1698b6f42d52ddf5cecfe50fe925c95e5 upstream.

There were multiple issues in the driver's probe function related to
error handling:

- Device's PM runtime status wasn't reverted to suspended on some errors
  in probe.

- Runtime PM was left enabled for the device on some probe errors.

- Device was left powered on if a probe failure happened or when it
  was removed when it was powered on.

- An extra pm_runtime_set_suspended() was issued in driver's remove
  function when the device was suspended.

Fix these bugs.

Fixes: 436190596241 ("media: imx214: Add imx214 camera sensor driver")
Cc: stable@vger.kernel.org # for >= v6.12
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: André Apitzsch <git@apitzsch.eu>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/media/i2c/imx214.c