From: Daniel Scally Date: Tue, 23 Nov 2021 00:00:01 +0000 (+0100) Subject: media: i2c: Re-order runtime pm initialisation X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=9a11fe9e4467e38b1e6c5049d9e086809e287040;p=linux.git media: i2c: Re-order runtime pm initialisation [ Upstream commit d2484fbf780762f6f9cc3abb7a07ee42dca2eaa3 ] 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. Fixes: 11c0d8fdccc5 ("media: i2c: Add support for the OV8865 image sensor") Signed-off-by: Daniel Scally Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- diff --git a/drivers/media/i2c/ov8865.c b/drivers/media/i2c/ov8865.c index ff8908a38061a..c6cebffabfc76 100644 --- a/drivers/media/i2c/ov8865.c +++ b/drivers/media/i2c/ov8865.c @@ -2899,8 +2899,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 */