[PATCH v2 01/15] media: i2c: os05b10: Use pm_runtime_get_if_active() when applying controls
From: Tarang Raval
Date: Wed Mar 25 2026 - 08:27:59 EST
os05b10_set_ctrl() currently uses pm_runtime_get_if_in_use() to decide
whether controls should be applied to hardware.
This is not correct for the intended behavior. If the runtime PM usage
count is 0 while the device is still active, pm_runtime_get_if_in_use()
returns 0 and the control update is skipped, leaving the software state
updated but not the hardware state.
Use pm_runtime_get_if_active() instead so controls are applied whenever
the device is runtime-active, regardless of the current usage count.
Cc: stable@xxxxxxxxxxxxxxx
Fixes: 3aa9296a23ec4("media: i2c: add os05b10 image sensor driver")
Signed-off-by: Tarang Raval <tarang.raval@xxxxxxxxxxxxxxxxx>
---
drivers/media/i2c/os05b10.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/media/i2c/os05b10.c b/drivers/media/i2c/os05b10.c
index e0453c988e4a..5da5b7d21f31 100644
--- a/drivers/media/i2c/os05b10.c
+++ b/drivers/media/i2c/os05b10.c
@@ -531,7 +531,7 @@ static int os05b10_set_ctrl(struct v4l2_ctrl *ctrl)
return ret;
}
- if (pm_runtime_get_if_in_use(os05b10->dev) == 0)
+ if (pm_runtime_get_if_active(os05b10->dev) == 0)
return 0;
switch (ctrl->id) {
--
2.34.1