OSDN Git Service

media: smiapp: Use pm_runtime_get_if_active
authorSakari Ailus <sakari.ailus@linux.intel.com>
Wed, 16 Oct 2019 11:19:30 +0000 (13:19 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Tue, 23 Jun 2020 13:14:06 +0000 (15:14 +0200)
Use the convenience function pm_runtime_get_if_active() instead of a
number of calls to runtime PM to figure out if the device was already
powered up.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/i2c/smiapp/smiapp-core.c

index 0a8d274..8a9c7de 100644 (file)
@@ -508,9 +508,7 @@ static int smiapp_set_ctrl(struct v4l2_ctrl *ctrl)
                break;
        }
 
-       pm_runtime_get_noresume(&client->dev);
-       pm_status = pm_runtime_get_if_in_use(&client->dev);
-       pm_runtime_put_noidle(&client->dev);
+       pm_status = pm_runtime_get_if_active(&client->dev, true);
        if (!pm_status)
                return 0;