diff mbox series

[13/16] soc: imx: gpcv2: correct pm_runtime_get_sync usage

Message ID 20210429073050.21039-14-peng.fan@oss.nxp.com
State New
Headers show
Series soc: imx: gpcv2: support i.MX8MM | expand

Commit Message

Peng Fan (OSS) April 29, 2021, 7:30 a.m. UTC
From: Peng Fan <peng.fan@nxp.com>


When the return value is negative, there is error, otherwise it is
expected.

Signed-off-by: Peng Fan <peng.fan@nxp.com>

---
 drivers/soc/imx/gpcv2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.30.0

Comments

Lucas Stach April 29, 2021, 2:25 p.m. UTC | #1
Am Donnerstag, dem 29.04.2021 um 15:30 +0800 schrieb Peng Fan (OSS):
> From: Peng Fan <peng.fan@nxp.com>

> 

> When the return value is negative, there is error, otherwise it is

> expected.


Good catch! As the runtime pm handling is added in this series, this
should be squashed into patch 06/16 to not add broken code and then fix
it in the same series. Change looks good to me.

> Signed-off-by: Peng Fan <peng.fan@nxp.com>

> ---

>  drivers/soc/imx/gpcv2.c | 2 +-

>  1 file changed, 1 insertion(+), 1 deletion(-)

> 

> diff --git a/drivers/soc/imx/gpcv2.c b/drivers/soc/imx/gpcv2.c

> index 42b9be05e1f2..d2ce47a5ebad 100644

> --- a/drivers/soc/imx/gpcv2.c

> +++ b/drivers/soc/imx/gpcv2.c

> @@ -197,7 +197,7 @@ static int imx_pgc_power_up(struct generic_pm_domain *genpd)

>  	int ret;

>  

> 

> 

> 

>  	ret = pm_runtime_get_sync(domain->dev);

> -	if (ret) {

> +	if (ret < 0) {

>  		pm_runtime_put_noidle(domain->dev);

>  		return ret;

>  	}
Peng Fan (OSS) April 30, 2021, 4:43 a.m. UTC | #2
On 2021/4/29 22:25, Lucas Stach wrote:
> Am Donnerstag, dem 29.04.2021 um 15:30 +0800 schrieb Peng Fan (OSS):

>> From: Peng Fan <peng.fan@nxp.com>

>>

>> When the return value is negative, there is error, otherwise it is

>> expected.

> 

> Good catch! As the runtime pm handling is added in this series, this

> should be squashed into patch 06/16 to not add broken code and then fix

> it in the same series. Change looks good to me.


Sure. This will be squashed into patch 06/16 in V2.

Thanks,
Peng.

> 

>> Signed-off-by: Peng Fan <peng.fan@nxp.com>

>> ---

>>   drivers/soc/imx/gpcv2.c | 2 +-

>>   1 file changed, 1 insertion(+), 1 deletion(-)

>>

>> diff --git a/drivers/soc/imx/gpcv2.c b/drivers/soc/imx/gpcv2.c

>> index 42b9be05e1f2..d2ce47a5ebad 100644

>> --- a/drivers/soc/imx/gpcv2.c

>> +++ b/drivers/soc/imx/gpcv2.c

>> @@ -197,7 +197,7 @@ static int imx_pgc_power_up(struct generic_pm_domain *genpd)

>>   	int ret;

>>   

>>

>>

>>

>>   	ret = pm_runtime_get_sync(domain->dev);

>> -	if (ret) {

>> +	if (ret < 0) {

>>   		pm_runtime_put_noidle(domain->dev);

>>   		return ret;

>>   	}

> 

>
diff mbox series

Patch

diff --git a/drivers/soc/imx/gpcv2.c b/drivers/soc/imx/gpcv2.c
index 42b9be05e1f2..d2ce47a5ebad 100644
--- a/drivers/soc/imx/gpcv2.c
+++ b/drivers/soc/imx/gpcv2.c
@@ -197,7 +197,7 @@  static int imx_pgc_power_up(struct generic_pm_domain *genpd)
 	int ret;
 
 	ret = pm_runtime_get_sync(domain->dev);
-	if (ret) {
+	if (ret < 0) {
 		pm_runtime_put_noidle(domain->dev);
 		return ret;
 	}