Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

media: i2c: dw9768: use pm_runtime_resume_and_get()

Commit dd8088d5a896 ("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.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

+1 -9
+1 -9
drivers/media/i2c/dw9768.c
··· 374 374 375 375 static int dw9768_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh) 376 376 { 377 - int ret; 378 - 379 - ret = pm_runtime_get_sync(sd->dev); 380 - if (ret < 0) { 381 - pm_runtime_put_noidle(sd->dev); 382 - return ret; 383 - } 384 - 385 - return 0; 377 + return pm_runtime_resume_and_get(sd->dev); 386 378 } 387 379 388 380 static int dw9768_close(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)