[PATCH v2 14/16] media: i2c: isl7998x: power down the decoder on remove
From: Cong Nguyen
Date: Mon Nov 23 2026 - 10:41:20 EST
isl7998x_pre_streamon() takes a runtime PM reference with
pm_runtime_resume_and_get(), which isl7998x_post_streamoff() drops.
isl7998x_remove() only calls pm_runtime_disable(), which does not run
the runtime suspend callback, so a device that is still runtime active
when the driver is unbound can be left with its power-down GPIO deasserted.
After disabling runtime PM, call isl7998x_runtime_suspend() if the
device is not runtime suspended, and set the runtime PM status to
suspended.
This issue was found by auditing the driver with an LLM coding assistant.
Fixes: 51ef2be546e2 ("media: i2c: isl7998x: Add driver for Intersil ISL7998x")
Signed-off-by: Cong Nguyen <congnt264@xxxxxxxxx>
---
drivers/media/i2c/isl7998x.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/media/i2c/isl7998x.c b/drivers/media/i2c/isl7998x.c
index 42387bd310fb..48fb131c9e45 100644
--- a/drivers/media/i2c/isl7998x.c
+++ b/drivers/media/i2c/isl7998x.c
@@ -1597,6 +1597,10 @@ static void isl7998x_remove(struct i2c_client *client)
struct isl7998x *isl7998x = i2c_to_isl7998x(client);
pm_runtime_disable(&client->dev);
+ if (!pm_runtime_status_suspended(&client->dev)) {
+ isl7998x_runtime_suspend(&client->dev);
+ pm_runtime_set_suspended(&client->dev);
+ }
v4l2_async_unregister_subdev(&isl7998x->subdev);
isl7998x_remove_controls(isl7998x);
media_entity_cleanup(&isl7998x->subdev.entity);
--
2.25.1