diff mbox series

[v4,13/16] media: i2c: Re-order runtime pm initialisation

Message ID 20211101001119.46056-14-djrscally@gmail.com (mailing list archive)
State New, archived
Headers show
Series Extensions to ov8865 driver | expand

Commit Message

Daniel Scally Nov. 1, 2021, 12:11 a.m. UTC
The kerneldoc for pm_runtime_set_suspended() says:

"It is not valid to call this function for devices with runtime PM
enabled"

To satisfy that requirement, re-order the calls so that
pm_runtime_enable() is the last one.

Signed-off-by: Daniel Scally <djrscally@gmail.com>
---
 drivers/media/i2c/ov8865.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Andy Shevchenko Nov. 1, 2021, 11:30 a.m. UTC | #1
On Mon, Nov 01, 2021 at 12:11:16AM +0000, Daniel Scally wrote:
> The kerneldoc for pm_runtime_set_suspended() says:
> 
> "It is not valid to call this function for devices with runtime PM
> enabled"
> 
> To satisfy that requirement, re-order the calls so that
> pm_runtime_enable() is the last one.

Shouldn't this be a fix with Fixes tag applied?
Daniel Scally Nov. 2, 2021, 8:30 a.m. UTC | #2
Hi Andy

On 01/11/2021 11:30, Andy Shevchenko wrote:
> On Mon, Nov 01, 2021 at 12:11:16AM +0000, Daniel Scally wrote:
>> The kerneldoc for pm_runtime_set_suspended() says:
>>
>> "It is not valid to call this function for devices with runtime PM
>> enabled"
>>
>> To satisfy that requirement, re-order the calls so that
>> pm_runtime_enable() is the last one.
> Shouldn't this be a fix with Fixes tag applied?
>
Yes I guess so - thanks, I'll add it
diff mbox series

Patch

diff --git a/drivers/media/i2c/ov8865.c b/drivers/media/i2c/ov8865.c
index 5f19d82554df..18b5f1e8e9a7 100644
--- a/drivers/media/i2c/ov8865.c
+++ b/drivers/media/i2c/ov8865.c
@@ -3085,8 +3085,8 @@  static int ov8865_probe(struct i2c_client *client)
 
 	/* Runtime PM */
 
-	pm_runtime_enable(sensor->dev);
 	pm_runtime_set_suspended(sensor->dev);
+	pm_runtime_enable(sensor->dev);
 
 	/* V4L2 subdev register */