All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] phy/motorola: using pm_runtime_resume_and_get instead of pm_runtime_get_sync
@ 2022-04-13  9:36 ` cgel.zte
  0 siblings, 0 replies; 4+ messages in thread
From: cgel.zte @ 2022-04-13  9:36 UTC (permalink / raw)
  To: kishon; +Cc: vkoul, linux-phy, linux-kernel, Minghao Chi, Zeal Robot

From: Minghao Chi <chi.minghao@zte.com.cn>

Using pm_runtime_resume_and_get is more appropriate
for simplifing code

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
---
 drivers/phy/motorola/phy-mapphone-mdm6600.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/phy/motorola/phy-mapphone-mdm6600.c b/drivers/phy/motorola/phy-mapphone-mdm6600.c
index 5172971f4c36..8738d512131d 100644
--- a/drivers/phy/motorola/phy-mapphone-mdm6600.c
+++ b/drivers/phy/motorola/phy-mapphone-mdm6600.c
@@ -253,12 +253,9 @@ static irqreturn_t phy_mdm6600_wakeirq_thread(int irq, void *data)
 		return IRQ_NONE;
 
 	dev_dbg(ddata->dev, "OOB wake on mode_gpio1: %i\n", wakeup);
-	error = pm_runtime_get_sync(ddata->dev);
-	if (error < 0) {
-		pm_runtime_put_noidle(ddata->dev);
-
+	error = pm_runtime_resume_and_get(ddata->dev);
+	if (error < 0)
 		return IRQ_NONE;
-	}
 
 	/* Just wake-up and kick the autosuspend timer */
 	pm_runtime_mark_last_busy(ddata->dev);
@@ -601,10 +598,9 @@ static int phy_mdm6600_probe(struct platform_device *pdev)
 	pm_runtime_set_autosuspend_delay(ddata->dev,
 					 MDM6600_MODEM_IDLE_DELAY_MS);
 	pm_runtime_enable(ddata->dev);
-	error = pm_runtime_get_sync(ddata->dev);
+	error = pm_runtime_resume_and_get(ddata->dev);
 	if (error < 0) {
 		dev_warn(ddata->dev, "failed to wake modem: %i\n", error);
-		pm_runtime_put_noidle(ddata->dev);
 		goto cleanup;
 	}
 
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] phy/motorola: using pm_runtime_resume_and_get instead of pm_runtime_get_sync
@ 2022-04-13  9:36 ` cgel.zte
  0 siblings, 0 replies; 4+ messages in thread
From: cgel.zte @ 2022-04-13  9:36 UTC (permalink / raw)
  To: kishon; +Cc: vkoul, linux-phy, linux-kernel, Minghao Chi, Zeal Robot

From: Minghao Chi <chi.minghao@zte.com.cn>

Using pm_runtime_resume_and_get is more appropriate
for simplifing code

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
---
 drivers/phy/motorola/phy-mapphone-mdm6600.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/phy/motorola/phy-mapphone-mdm6600.c b/drivers/phy/motorola/phy-mapphone-mdm6600.c
index 5172971f4c36..8738d512131d 100644
--- a/drivers/phy/motorola/phy-mapphone-mdm6600.c
+++ b/drivers/phy/motorola/phy-mapphone-mdm6600.c
@@ -253,12 +253,9 @@ static irqreturn_t phy_mdm6600_wakeirq_thread(int irq, void *data)
 		return IRQ_NONE;
 
 	dev_dbg(ddata->dev, "OOB wake on mode_gpio1: %i\n", wakeup);
-	error = pm_runtime_get_sync(ddata->dev);
-	if (error < 0) {
-		pm_runtime_put_noidle(ddata->dev);
-
+	error = pm_runtime_resume_and_get(ddata->dev);
+	if (error < 0)
 		return IRQ_NONE;
-	}
 
 	/* Just wake-up and kick the autosuspend timer */
 	pm_runtime_mark_last_busy(ddata->dev);
@@ -601,10 +598,9 @@ static int phy_mdm6600_probe(struct platform_device *pdev)
 	pm_runtime_set_autosuspend_delay(ddata->dev,
 					 MDM6600_MODEM_IDLE_DELAY_MS);
 	pm_runtime_enable(ddata->dev);
-	error = pm_runtime_get_sync(ddata->dev);
+	error = pm_runtime_resume_and_get(ddata->dev);
 	if (error < 0) {
 		dev_warn(ddata->dev, "failed to wake modem: %i\n", error);
-		pm_runtime_put_noidle(ddata->dev);
 		goto cleanup;
 	}
 
-- 
2.25.1



-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] phy/motorola: using pm_runtime_resume_and_get instead of pm_runtime_get_sync
  2022-04-13  9:36 ` cgel.zte
@ 2022-04-13 10:55   ` Vinod Koul
  -1 siblings, 0 replies; 4+ messages in thread
From: Vinod Koul @ 2022-04-13 10:55 UTC (permalink / raw)
  To: cgel.zte; +Cc: kishon, linux-phy, linux-kernel, Minghao Chi, Zeal Robot

On 13-04-22, 09:36, cgel.zte@gmail.com wrote:
> From: Minghao Chi <chi.minghao@zte.com.cn>
> 
> Using pm_runtime_resume_and_get is more appropriate
> for simplifing code

Can you explain why is it more appropriate?

> 
> Reported-by: Zeal Robot <zealci@zte.com.cn>

where is this report?

> Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
> ---
>  drivers/phy/motorola/phy-mapphone-mdm6600.c | 10 +++-------
>  1 file changed, 3 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/phy/motorola/phy-mapphone-mdm6600.c b/drivers/phy/motorola/phy-mapphone-mdm6600.c
> index 5172971f4c36..8738d512131d 100644
> --- a/drivers/phy/motorola/phy-mapphone-mdm6600.c
> +++ b/drivers/phy/motorola/phy-mapphone-mdm6600.c
> @@ -253,12 +253,9 @@ static irqreturn_t phy_mdm6600_wakeirq_thread(int irq, void *data)
>  		return IRQ_NONE;
>  
>  	dev_dbg(ddata->dev, "OOB wake on mode_gpio1: %i\n", wakeup);
> -	error = pm_runtime_get_sync(ddata->dev);
> -	if (error < 0) {
> -		pm_runtime_put_noidle(ddata->dev);
> -
> +	error = pm_runtime_resume_and_get(ddata->dev);
> +	if (error < 0)
>  		return IRQ_NONE;
> -	}
>  
>  	/* Just wake-up and kick the autosuspend timer */
>  	pm_runtime_mark_last_busy(ddata->dev);
> @@ -601,10 +598,9 @@ static int phy_mdm6600_probe(struct platform_device *pdev)
>  	pm_runtime_set_autosuspend_delay(ddata->dev,
>  					 MDM6600_MODEM_IDLE_DELAY_MS);
>  	pm_runtime_enable(ddata->dev);
> -	error = pm_runtime_get_sync(ddata->dev);
> +	error = pm_runtime_resume_and_get(ddata->dev);
>  	if (error < 0) {
>  		dev_warn(ddata->dev, "failed to wake modem: %i\n", error);
> -		pm_runtime_put_noidle(ddata->dev);
>  		goto cleanup;
>  	}
>  
> -- 
> 2.25.1
> 

-- 
~Vinod

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] phy/motorola: using pm_runtime_resume_and_get instead of pm_runtime_get_sync
@ 2022-04-13 10:55   ` Vinod Koul
  0 siblings, 0 replies; 4+ messages in thread
From: Vinod Koul @ 2022-04-13 10:55 UTC (permalink / raw)
  To: cgel.zte; +Cc: kishon, linux-phy, linux-kernel, Minghao Chi, Zeal Robot

On 13-04-22, 09:36, cgel.zte@gmail.com wrote:
> From: Minghao Chi <chi.minghao@zte.com.cn>
> 
> Using pm_runtime_resume_and_get is more appropriate
> for simplifing code

Can you explain why is it more appropriate?

> 
> Reported-by: Zeal Robot <zealci@zte.com.cn>

where is this report?

> Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
> ---
>  drivers/phy/motorola/phy-mapphone-mdm6600.c | 10 +++-------
>  1 file changed, 3 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/phy/motorola/phy-mapphone-mdm6600.c b/drivers/phy/motorola/phy-mapphone-mdm6600.c
> index 5172971f4c36..8738d512131d 100644
> --- a/drivers/phy/motorola/phy-mapphone-mdm6600.c
> +++ b/drivers/phy/motorola/phy-mapphone-mdm6600.c
> @@ -253,12 +253,9 @@ static irqreturn_t phy_mdm6600_wakeirq_thread(int irq, void *data)
>  		return IRQ_NONE;
>  
>  	dev_dbg(ddata->dev, "OOB wake on mode_gpio1: %i\n", wakeup);
> -	error = pm_runtime_get_sync(ddata->dev);
> -	if (error < 0) {
> -		pm_runtime_put_noidle(ddata->dev);
> -
> +	error = pm_runtime_resume_and_get(ddata->dev);
> +	if (error < 0)
>  		return IRQ_NONE;
> -	}
>  
>  	/* Just wake-up and kick the autosuspend timer */
>  	pm_runtime_mark_last_busy(ddata->dev);
> @@ -601,10 +598,9 @@ static int phy_mdm6600_probe(struct platform_device *pdev)
>  	pm_runtime_set_autosuspend_delay(ddata->dev,
>  					 MDM6600_MODEM_IDLE_DELAY_MS);
>  	pm_runtime_enable(ddata->dev);
> -	error = pm_runtime_get_sync(ddata->dev);
> +	error = pm_runtime_resume_and_get(ddata->dev);
>  	if (error < 0) {
>  		dev_warn(ddata->dev, "failed to wake modem: %i\n", error);
> -		pm_runtime_put_noidle(ddata->dev);
>  		goto cleanup;
>  	}
>  
> -- 
> 2.25.1
> 

-- 
~Vinod

-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-04-13 10:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-13  9:36 [PATCH] phy/motorola: using pm_runtime_resume_and_get instead of pm_runtime_get_sync cgel.zte
2022-04-13  9:36 ` cgel.zte
2022-04-13 10:55 ` Vinod Koul
2022-04-13 10:55   ` Vinod Koul

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.