Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753755AbbDBOVv (ORCPT ); Thu, 2 Apr 2015 10:21:51 -0400 Received: from iolanthe.rowland.org ([192.131.102.54]:48732 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1753728AbbDBOVs (ORCPT ); Thu, 2 Apr 2015 10:21:48 -0400 Date: Thu, 2 Apr 2015 10:21:46 -0400 (EDT) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: Arun Ramamurthy cc: Kishon Vijay Abraham I , Tony Prisk , Greg Kroah-Hartman , Arnd Bergmann , , , , Dmitry Torokhov , Anatol Pomazau , Jonathan Richardson , Scott Branden , Ray Jui , Subject: Re: [PATCH v1 2/3] usb: ehci-platform: Use devm_of_phy_get_by_index In-Reply-To: <1427921349-18173-3-git-send-email-arun.ramamurthy@broadcom.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1775 Lines: 55 On Wed, 1 Apr 2015, Arun Ramamurthy wrote: > Getting phys by index instead of phy names so that we do > not have to create a naming scheme when multiple phys > are present > > Signed-off-by: Arun Ramamurthy > Reviewed-by: Ray Jui > Reviewed-by: Scott Branden > @@ -204,36 +197,23 @@ static int ehci_platform_probe(struct platform_device *dev) > > priv->num_phys = of_count_phandle_with_args(dev->dev.of_node, > "phys", "#phy-cells"); > - priv->num_phys = priv->num_phys > 0 ? priv->num_phys : 1; > > - priv->phys = devm_kcalloc(&dev->dev, priv->num_phys, > - sizeof(struct phy *), GFP_KERNEL); > - if (!priv->phys) > - return -ENOMEM; > + if (priv->num_phys > 0) { > + priv->phys = devm_kcalloc(&dev->dev, priv->num_phys, > + sizeof(struct phy *), GFP_KERNEL); > + if (!priv->phys) > + return -ENOMEM; > + } else > + priv->num_phys = 0; This last line isn't needed. A negative value for priv->num_phys will work just as well as 0. > + priv->phys[phy_num] = devm_of_phy_get_by_index(&dev->dev > + , dev->dev.of_node > + , phy_num); What's with the funny placement of the commas? Are you trying to avoid breaking the 80-column rule? It should look like this: priv->phys[phy_num] = devm_of_phy_get_by_index( &dev->dev, dev->dev.of_node, phy_num); When you fix this, you can add: Acked-by: Alan Stern The same comments apply to your 3/3 patch. Alan Stern -- 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/