Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752610AbbDPEzz (ORCPT ); Thu, 16 Apr 2015 00:55:55 -0400 Received: from mail-ig0-f181.google.com ([209.85.213.181]:33221 "EHLO mail-ig0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750919AbbDPEzp (ORCPT ); Thu, 16 Apr 2015 00:55:45 -0400 MIME-Version: 1.0 In-Reply-To: References: Date: Thu, 16 Apr 2015 10:25:44 +0530 Message-ID: Subject: Re: [PATCHv2 2/3] usb: ehci-platform: Use devm_of_phy_get_by_index From: rajeev kumar To: Alan Stern Cc: Arun Ramamurthy , Kishon Vijay Abraham I , Tony Prisk , Greg Kroah-Hartman , Arnd Bergmann , Felipe Balbi , Mathias Nyman , Paul Bolle , Thomas Pugliese , Srinivas Kandagatla , David Mosberger , Peter Griffin , Gregory CLEMENT , Laurent Pinchart , Kevin Hao , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , linux-usb@vger.kernel.org, Dmitry Torokhov , Anatol Pomazau , Jonathan Richardson , Scott Branden , Ray Jui , bcm-kernel-feedback-list@broadcom.com Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2183 Lines: 60 On Wed, Apr 15, 2015 at 8:06 PM, Alan Stern 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]); >> > } > > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/