提交 2450f59d 编写于 作者: M Mauro Carvalho Chehab

media: i2c: ccs-core: use pm_runtime_resume_and_get()

Commit dd8088d5 ("PM: runtime: Add pm_runtime_resume_and_get to deal with usage counter")
added pm_runtime_resume_and_get() in order to automatically handle
dev->power.usage_count decrement on errors.

Use the new API, in order to cleanup the error check logic.
Reviewed-by: NJonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: NMauro Carvalho Chehab <mchehab+huawei@kernel.org>
上级 a959a7bf
...@@ -3101,12 +3101,9 @@ static int __maybe_unused ccs_suspend(struct device *dev) ...@@ -3101,12 +3101,9 @@ static int __maybe_unused ccs_suspend(struct device *dev)
bool streaming = sensor->streaming; bool streaming = sensor->streaming;
int rval; int rval;
rval = pm_runtime_get_sync(dev); rval = pm_runtime_resume_and_get(dev);
if (rval < 0) { if (rval < 0)
pm_runtime_put_noidle(dev);
return rval; return rval;
}
if (sensor->streaming) if (sensor->streaming)
ccs_stop_streaming(sensor); ccs_stop_streaming(sensor);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册