diff options
| author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2023-09-14 20:20:54 +0300 |
|---|---|---|
| committer | Hans Verkuil <hverkuil-cisco@xs4all.nl> | 2023-09-27 09:39:57 +0200 |
| commit | b92f8f3591aca18fe677092fcc567c698368f651 (patch) | |
| tree | e0161c44a78b1c014f8cbc0a819689a7d67be2dd /drivers/media/i2c/ccs/ccs-core.c | |
| parent | 20290feaaeb76cc719921aad275ccb18662a7c3a (diff) | |
media: i2c: Use pm_runtime_resume_and_get()
Simplify error handling by using pm_runtime_resume_and_get() instead of
pm_runtime_get_sync() with a put call in the error path.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Benjamin Mugnier <benjamin.mugnier@foss.st.com> (st-vgxy61)
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Diffstat (limited to 'drivers/media/i2c/ccs/ccs-core.c')
| -rw-r--r-- | drivers/media/i2c/ccs/ccs-core.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/media/i2c/ccs/ccs-core.c b/drivers/media/i2c/ccs/ccs-core.c index 49e0d9a09530..569bf9b67539 100644 --- a/drivers/media/i2c/ccs/ccs-core.c +++ b/drivers/media/i2c/ccs/ccs-core.c @@ -1893,9 +1893,9 @@ static int ccs_pm_get_init(struct ccs_sensor *sensor) * relies at the returned value to detect if the device was already * active or not. */ - rval = pm_runtime_get_sync(&client->dev); - if (rval < 0) - goto error; + rval = pm_runtime_resume_and_get(&client->dev); + if (rval) + return rval; /* Device was already active, so don't set controls */ if (rval == 1) |