]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
media: i2c: imx334: Fix runtime PM handling in remove function
authorTarang Raval <tarang.raval@siliconsignals.io>
Sat, 29 Mar 2025 05:43:28 +0000 (11:13 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 27 Jun 2025 10:05:29 +0000 (11:05 +0100)
commit1db83a0b4f1f80d5255a5da991fb5ecd4481abcd
tree1d9912dec896d6166fa2c31d40acc0b72c37b7b1
parent498e95513b5bc944e50cad14d69180f357a41a39
media: i2c: imx334: Fix runtime PM handling in remove function

[ Upstream commit b493cd3c03641f9bbaa9787e43ca92163cb50051 ]

pm_runtime_suspended() only checks the current runtime PM status and does
not modify it, making it ineffective in this context. This could result in
improper power management if the device remains active when removed.

This patch fixes the issue by introducing a check with
pm_runtime_status_suspended() to determine if the device is already
suspended. If it is not, it calls imx334_power_off() to power down the
device and then uses pm_runtime_set_suspended() to correctly update the
runtime PM status to suspended.

Signed-off-by: Tarang Raval <tarang.raval@siliconsignals.io>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/media/i2c/imx334.c