diff mbox

[2/2] phy-core: Don't propagate -ENOSUPP from phy_pm_runtime_get_sync to caller

Message ID 1388963189-13556-2-git-send-email-hdegoede@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Hans de Goede Jan. 5, 2014, 11:06 p.m. UTC
The phy-core allows phy_init and phy_power_on to be called multiple times,
but before this patch -ENOSUPP from phy_pm_runtime_get_sync would be
propagated to the caller for the 2nd and later calls.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/phy/phy-core.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Sergei Shtylyov Jan. 6, 2014, 5:37 p.m. UTC | #1
Hello.

On 06-01-2014 3:06, Hans de Goede wrote:

> The phy-core allows phy_init and phy_power_on to be called multiple times,
> but before this patch -ENOSUPP from phy_pm_runtime_get_sync would be
> propagated to the caller for the 2nd and later calls.

> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
>   drivers/phy/phy-core.c | 6 ++++--
>   1 file changed, 4 insertions(+), 2 deletions(-)

> diff --git a/drivers/phy/phy-core.c b/drivers/phy/phy-core.c
> index d7b992e..8ee6157 100644
> --- a/drivers/phy/phy-core.c
> +++ b/drivers/phy/phy-core.c
> @@ -161,7 +161,8 @@ int phy_init(struct phy *phy)
>   			dev_err(&phy->dev, "phy init failed --> %d\n", ret);
>   			goto out;
>   		}
> -	}
> +	} else
> +		ret = 0; /* Override possible ret == -ENOTSUPP */

    *else* arm should have {} when the *if* arm has it.

> @@ -209,7 +210,8 @@ int phy_power_on(struct phy *phy)
>   			dev_err(&phy->dev, "phy poweron failed --> %d\n", ret);
>   			goto out;
>   		}
> -	}
> +	} else
> +		ret = 0; /* Override possible ret == -ENOTSUPP */

    Same here.

WBR, Sergei
Kishon Vijay Abraham I Jan. 7, 2014, 8:56 a.m. UTC | #2
Hi,

On Monday 06 January 2014 04:36 AM, Hans de Goede wrote:
> The phy-core allows phy_init and phy_power_on to be called multiple times,
> but before this patch -ENOSUPP from phy_pm_runtime_get_sync would be
> propagated to the caller for the 2nd and later calls.

Thanks for fixing this. Have one minor comment below.
> 
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
>  drivers/phy/phy-core.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/phy/phy-core.c b/drivers/phy/phy-core.c
> index d7b992e..8ee6157 100644
> --- a/drivers/phy/phy-core.c
> +++ b/drivers/phy/phy-core.c
> @@ -161,7 +161,8 @@ int phy_init(struct phy *phy)
>  			dev_err(&phy->dev, "phy init failed --> %d\n", ret);
>  			goto out;
>  		}
> -	}
> +	} else
> +		ret = 0; /* Override possible ret == -ENOTSUPP */

'should use braces in both branches'.
>  
>  out:
>  	mutex_unlock(&phy->mutex);
> @@ -209,7 +210,8 @@ int phy_power_on(struct phy *phy)
>  			dev_err(&phy->dev, "phy poweron failed --> %d\n", ret);
>  			goto out;
>  		}
> -	}
> +	} else
> +		ret = 0; /* Override possible ret == -ENOTSUPP */

same here..

Thanks
Kishon
Kishon Vijay Abraham I Jan. 7, 2014, 8:58 a.m. UTC | #3
On Tuesday 07 January 2014 02:26 PM, Kishon Vijay Abraham I wrote:
> Hi,
> 
> On Monday 06 January 2014 04:36 AM, Hans de Goede wrote:
>> The phy-core allows phy_init and phy_power_on to be called multiple times,
>> but before this patch -ENOSUPP from phy_pm_runtime_get_sync would be
>> propagated to the caller for the 2nd and later calls.
> 
> Thanks for fixing this. Have one minor comment below.
>>
>> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
>> ---
>>  drivers/phy/phy-core.c | 6 ++++--
>>  1 file changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/phy/phy-core.c b/drivers/phy/phy-core.c
>> index d7b992e..8ee6157 100644
>> --- a/drivers/phy/phy-core.c
>> +++ b/drivers/phy/phy-core.c
>> @@ -161,7 +161,8 @@ int phy_init(struct phy *phy)
>>  			dev_err(&phy->dev, "phy init failed --> %d\n", ret);
>>  			goto out;
>>  		}
>> -	}
>> +	} else
>> +		ret = 0; /* Override possible ret == -ENOTSUPP */
> 
> 'should use braces in both branches'.

ah.. Sergei had already commented :-)
>>  
>>  out:
>>  	mutex_unlock(&phy->mutex);
>> @@ -209,7 +210,8 @@ int phy_power_on(struct phy *phy)
>>  			dev_err(&phy->dev, "phy poweron failed --> %d\n", ret);
>>  			goto out;
>>  		}
>> -	}
>> +	} else
>> +		ret = 0; /* Override possible ret == -ENOTSUPP */
> 
> same here..
> 
> Thanks
> Kishon
>
Hans de Goede Jan. 7, 2014, 9:13 a.m. UTC | #4
Hi,

On 01/07/2014 09:56 AM, Kishon Vijay Abraham I wrote:
> Hi,
>
> On Monday 06 January 2014 04:36 AM, Hans de Goede wrote:
>> The phy-core allows phy_init and phy_power_on to be called multiple times,
>> but before this patch -ENOSUPP from phy_pm_runtime_get_sync would be
>> propagated to the caller for the 2nd and later calls.
>
> Thanks for fixing this. Have one minor comment below.
>>
>> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
>> ---
>>   drivers/phy/phy-core.c | 6 ++++--
>>   1 file changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/phy/phy-core.c b/drivers/phy/phy-core.c
>> index d7b992e..8ee6157 100644
>> --- a/drivers/phy/phy-core.c
>> +++ b/drivers/phy/phy-core.c
>> @@ -161,7 +161,8 @@ int phy_init(struct phy *phy)
>>   			dev_err(&phy->dev, "phy init failed --> %d\n", ret);
>>   			goto out;
>>   		}
>> -	}
>> +	} else
>> +		ret = 0; /* Override possible ret == -ENOTSUPP */
>
> 'should use braces in both branches'.

Ok, I'll do a v2 fixing this soonish, any comments on the first patch?

Regards,

Hans
diff mbox

Patch

diff --git a/drivers/phy/phy-core.c b/drivers/phy/phy-core.c
index d7b992e..8ee6157 100644
--- a/drivers/phy/phy-core.c
+++ b/drivers/phy/phy-core.c
@@ -161,7 +161,8 @@  int phy_init(struct phy *phy)
 			dev_err(&phy->dev, "phy init failed --> %d\n", ret);
 			goto out;
 		}
-	}
+	} else
+		ret = 0; /* Override possible ret == -ENOTSUPP */
 
 out:
 	mutex_unlock(&phy->mutex);
@@ -209,7 +210,8 @@  int phy_power_on(struct phy *phy)
 			dev_err(&phy->dev, "phy poweron failed --> %d\n", ret);
 			goto out;
 		}
-	}
+	} else
+		ret = 0; /* Override possible ret == -ENOTSUPP */
 
 out:
 	mutex_unlock(&phy->mutex);