lkml.org 
[lkml]   [2015]   [Apr]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCHv2 2/3] usb: ehci-platform: Use devm_of_phy_get_by_index
From
On Wed, Apr 15, 2015 at 8:06 PM, Alan Stern <stern@rowland.harvard.edu> wrote:
> On Wed, 15 Apr 2015, rajeev kumar wrote:
>
>> > @@ -88,15 +88,13 @@ static int ehci_platform_power_on(struct platform_device *dev)
>> > }
>> >
>> > for (phy_num = 0; phy_num < priv->num_phys; phy_num++) {
>> > - if (priv->phys[phy_num]) {
>> > - ret = phy_init(priv->phys[phy_num]);
>> > - if (ret)
>> > - goto err_exit_phy;
>> > - ret = phy_power_on(priv->phys[phy_num]);
>> > - if (ret) {
>> > - phy_exit(priv->phys[phy_num]);
>> > - goto err_exit_phy;
>> > - }
>> > + ret = phy_init(priv->phys[phy_num]);
>> > + if (ret)
>> > + goto err_exit_phy;
>>
>> Jumping to err_exit_phy will perform phy_power_off also which is not
>> required as you are are powering on after phy_init. Wrong level
>> jumping
>
> Look again, and this time pay more attention to the value of phy_num.
>
> Alan Stern

MIssed it , Thanks for the pointer.

~Rajeev

>
>> ~Rajeev
>>
>> > + ret = phy_power_on(priv->phys[phy_num]);
>> > + if (ret) {
>> > + phy_exit(priv->phys[phy_num]);
>> > + goto err_exit_phy;
>> > }
>> > }
>> >
>> > @@ -104,10 +102,8 @@ static int ehci_platform_power_on(struct platform_device *dev)
>> >
>> > err_exit_phy:
>> > while (--phy_num >= 0) {
>> > - if (priv->phys[phy_num]) {
>> > - phy_power_off(priv->phys[phy_num]);
>> > - phy_exit(priv->phys[phy_num]);
>> > - }
>> > + phy_power_off(priv->phys[phy_num]);
>> > + phy_exit(priv->phys[phy_num]);
>> > }
>
>


\
 
 \ /
  Last update: 2015-04-16 07:41    [W:0.082 / U:1.500 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site