LinuxTV Patchwork [2/8] rcar-vin: Remove unneeded calls to pm_runtime_{enable,disable}

login
register
mail settings
Submitter Niklas Söderlund
Date April 12, 2019, 11:43 p.m.
Message ID <20190412234359.5079-3-niklas.soderlund+renesas@ragnatech.se>
Download mbox | patch
Permalink /patch/55659/
State New
Headers show

Comments

Niklas Söderlund - April 12, 2019, 11:43 p.m.
Runtime PM is already enable unconditionally when the driver is probed
and disabled when it's removed. There is no point in doing it again for
Gen2 when opening and closing the video device.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
---
 drivers/media/platform/rcar-vin/rcar-v4l2.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
Sergei Shtylyov - April 13, 2019, 9:06 a.m.
On 13.04.2019 2:43, Niklas Söderlund wrote:

> Runtime PM is already enable unconditionally when the driver is probed

    Enabled?

> and disabled when it's removed. There is no point in doing it again for
> Gen2 when opening and closing the video device.
> 
> Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
[...]

MBR, Sergei
Ulrich Hecht - April 15, 2019, 11:21 a.m.
> On April 13, 2019 at 1:43 AM Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> wrote:
> 
> 
> Runtime PM is already enable unconditionally when the driver is probed
> and disabled when it's removed. There is no point in doing it again for
> Gen2 when opening and closing the video device.
> 
> Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
> ---
>  drivers/media/platform/rcar-vin/rcar-v4l2.c | 7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)
> 
> diff --git a/drivers/media/platform/rcar-vin/rcar-v4l2.c b/drivers/media/platform/rcar-vin/rcar-v4l2.c
> index b821ea01786eb1ff..0841f1a0bfd7ba3a 100644
> --- a/drivers/media/platform/rcar-vin/rcar-v4l2.c
> +++ b/drivers/media/platform/rcar-vin/rcar-v4l2.c
> @@ -797,8 +797,6 @@ static int rvin_initialize_device(struct file *file)
>  	if (ret < 0)
>  		return ret;
>  
> -	pm_runtime_enable(&vin->vdev.dev);
> -
>  	/*
>  	 * Try to configure with default parameters. Notice: this is the
>  	 * very first open, so, we cannot race against other calls,
> @@ -813,7 +811,6 @@ static int rvin_initialize_device(struct file *file)
>  
>  	return 0;
>  esfmt:
> -	pm_runtime_disable(&vin->vdev.dev);
>  	rvin_power_off(vin);
>  
>  	return ret;
> @@ -863,10 +860,8 @@ static int rvin_release(struct file *file)
>  	 * If this was the last open file.
>  	 * Then de-initialize hw module.
>  	 */
> -	if (fh_singular) {
> -		pm_runtime_disable(&vin->vdev.dev);
> +	if (fh_singular)
>  		rvin_power_off(vin);
> -	}
>  
>  	mutex_unlock(&vin->lock);
>  
> -- 
> 2.21.0
>

Reviewed-by: Ulrich Hecht <uli+renesas@fpond.eu>

CU
Uli

Patch

diff --git a/drivers/media/platform/rcar-vin/rcar-v4l2.c b/drivers/media/platform/rcar-vin/rcar-v4l2.c
index b821ea01786eb1ff..0841f1a0bfd7ba3a 100644
--- a/drivers/media/platform/rcar-vin/rcar-v4l2.c
+++ b/drivers/media/platform/rcar-vin/rcar-v4l2.c
@@ -797,8 +797,6 @@  static int rvin_initialize_device(struct file *file)
 	if (ret < 0)
 		return ret;
 
-	pm_runtime_enable(&vin->vdev.dev);
-
 	/*
 	 * Try to configure with default parameters. Notice: this is the
 	 * very first open, so, we cannot race against other calls,
@@ -813,7 +811,6 @@  static int rvin_initialize_device(struct file *file)
 
 	return 0;
 esfmt:
-	pm_runtime_disable(&vin->vdev.dev);
 	rvin_power_off(vin);
 
 	return ret;
@@ -863,10 +860,8 @@  static int rvin_release(struct file *file)
 	 * If this was the last open file.
 	 * Then de-initialize hw module.
 	 */
-	if (fh_singular) {
-		pm_runtime_disable(&vin->vdev.dev);
+	if (fh_singular)
 		rvin_power_off(vin);
-	}
 
 	mutex_unlock(&vin->lock);
 

Privacy Policy