From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752017AbbCTVbP (ORCPT ); Fri, 20 Mar 2015 17:31:15 -0400 Received: from mail-ie0-f169.google.com ([209.85.223.169]:33043 "EHLO mail-ie0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751157AbbCTVbM (ORCPT ); Fri, 20 Mar 2015 17:31:12 -0400 Date: Fri, 20 Mar 2015 14:31:08 -0700 From: Dmitry Torokhov To: Arun Ramamurthy Cc: Kishon Vijay Abraham I , Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , Arnd Bergmann , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, bcm-kernel-feedback-list@broadcom.com, linux-kernel@vger.kernel.org, Anatol Pomazau , Jonathan Richardson , Scott Branden , Ray Jui Subject: Re: [PATCH v1 1/3] phy: phy-core: allow specifying supply at port level Message-ID: <20150320213108.GB25405@dtor-ws> References: <1426886727-537-1-git-send-email-arun.ramamurthy@broadcom.com> <1426886727-537-2-git-send-email-arun.ramamurthy@broadcom.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1426886727-537-2-git-send-email-arun.ramamurthy@broadcom.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Arun, On Fri, Mar 20, 2015 at 02:25:25PM -0700, Arun Ramamurthy wrote: > Multi-port phy's may have per-port power supplies. Let's change phy core > to first attempt to look up the supply at the port level, and then, if > not found, check parent device. > > Reviewed-by: Ray Jui > Reviewed-by: Scott Branden > Signed-off-by: Dmitry Torokhov > Signed-off-by: Arun Ramamurthy > This should have had: From: Dmitry Torokhov as first line of the body of e-mail as the patch was authored by me. Thanks. --- > drivers/phy/phy-core.c | 30 ++++++++++++++++++++---------- > 1 file changed, 20 insertions(+), 10 deletions(-) > > diff --git a/drivers/phy/phy-core.c b/drivers/phy/phy-core.c > index a12d353..b43bb6b 100644 > --- a/drivers/phy/phy-core.c > +++ b/drivers/phy/phy-core.c > @@ -650,16 +650,6 @@ struct phy *phy_create(struct device *dev, struct device_node *node, > goto free_phy; > } > > - /* phy-supply */ > - phy->pwr = regulator_get_optional(dev, "phy"); > - if (IS_ERR(phy->pwr)) { > - if (PTR_ERR(phy->pwr) == -EPROBE_DEFER) { > - ret = -EPROBE_DEFER; > - goto free_ida; > - } > - phy->pwr = NULL; > - } > - > device_initialize(&phy->dev); > mutex_init(&phy->mutex); > > @@ -673,6 +663,26 @@ struct phy *phy_create(struct device *dev, struct device_node *node, > if (ret) > goto put_dev; > > + /* > + * Locate phy-supply. We first try individual port and then, > + * if supply is not found, try parent device. > + */ > + phy->pwr = regulator_get_optional(&phy->dev, "phy"); > + if (IS_ERR(phy->pwr)) { > + ret = PTR_ERR(phy->pwr); > + if (ret == -EPROBE_DEFER) > + goto free_ida; > + > + phy->pwr = regulator_get_optional(phy->dev.parent, "phy"); > + if (IS_ERR(phy->pwr)) { > + ret = PTR_ERR(phy->pwr); > + if (ret == -EPROBE_DEFER) > + goto free_ida; > + > + phy->pwr = NULL; > + } > + } > + > ret = device_add(&phy->dev); > if (ret) > goto put_dev; > -- > 2.3.2 > -- Dmitry