]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
media: i2c: imx219: Rectify runtime PM handling in probe and remove
authorSakari Ailus <sakari.ailus@linux.intel.com>
Fri, 10 Jan 2025 12:53:20 +0000 (14:53 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 20 Apr 2025 08:18:03 +0000 (10:18 +0200)
commit456c1739cd45654b7e2d139791cf25a325e464e3
tree957296ca0246217637455ec3051ca62b78911626
parentd4e8297165bf6dc03545ae4a95bb3a869be3a315
media: i2c: imx219: Rectify runtime PM handling in probe and remove

commit 42eceae9793566d0df53d509be3e416465c347f5 upstream.

Set the device's runtime PM status and enable runtime PM before
registering the async sub-device. This is needed to avoid the case where
the device is runtime PM resumed while runtime PM has not been enabled
yet.

Also set the device's runtime PM status to suspended in remove only if it
wasn't so already.

Fixes: 1283b3b8f82b ("media: i2c: Add driver for Sony IMX219 sensor")
Cc: stable@vger.kernel.org # for >= v6.6
Reviewed-by: Bingbu Cao <bingbu.cao@intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/media/i2c/imx219.c