From patchwork Thu May 22 16:47:48 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 351567 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 04C6814008A for ; Fri, 23 May 2014 02:53:41 +1000 (EST) Received: from ozlabs.org (ozlabs.org [103.22.144.67]) by lists.ozlabs.org (Postfix) with ESMTP id C9F2A1A0AF0 for ; Fri, 23 May 2014 02:53:40 +1000 (EST) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from mail-ig0-x22e.google.com (mail-ig0-x22e.google.com [IPv6:2607:f8b0:4001:c05::22e]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 025241A05ED for ; Fri, 23 May 2014 02:48:27 +1000 (EST) Received: by mail-ig0-f174.google.com with SMTP id h3so7870751igd.1 for ; Thu, 22 May 2014 09:48:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=gMe8+NDDZIZeDL1nlcu2dgWhnNbcXYE0MLuMIPfvj10=; b=ULMLlnHN1yz/t2AHVZB8dBh+PxVkAtlbM+txfUbNXFQOpJtx4AVwpIahK0G1ilRRrP iiv+5NyvDIQz7/4NJ3nePmZZV20K0lFAgzsuOb8kX6mEXKU6eb9QhQGViA83qKtku7Wh vmtzmamDy4ah/Sgklha5b0GXYEuwe33c5CSHE3VtwVC8LnBw6ufCkad4tCh17qIsu6cA dG/l6vBaBPNdLyjllQvbVmSPmmBvleQwH9az0vZvAhK9aI0y5O73SvbN0yvrvajMe3jU pHCccPXBVEgY60IFDmTM9Bk2v61UDQP3y90/RO2pCtCJ9+ClcQaOtCSCW4/3SxE0bA+g 1D2w== X-Received: by 10.43.18.198 with SMTP id qh6mr54963212icb.52.1400777304960; Thu, 22 May 2014 09:48:24 -0700 (PDT) Received: from fainelli-desktop.broadcom.com (5520-maca-inet1-outside.broadcom.com. [216.31.211.11]) by mx.google.com with ESMTPSA id ql7sm14455104igc.19.2014.05.22.09.48.23 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 22 May 2014 09:48:24 -0700 (PDT) From: Florian Fainelli To: netdev@vger.kernel.org Subject: [PATCH net-next v2 6/9] gianfar: use the new fixed PHY helpers Date: Thu, 22 May 2014 09:47:48 -0700 Message-Id: <1400777271-32199-7-git-send-email-f.fainelli@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1400777271-32199-1-git-send-email-f.fainelli@gmail.com> References: <1400777271-32199-1-git-send-email-f.fainelli@gmail.com> Cc: Thomas Petazzoni , "open list:OPEN FIRMWARE AND..." , Florian Fainelli , Aida Mynzhasova , Sergei Shtylyov , Richard Cochran , open list , Claudiu Manoil , Vitaly Bordug , Grant Likely , "open list:LINUX FOR POWERPC..." , davem@davemloft.net X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" of_phy_connect_fixed_link() is becoming obsolete, and also required platform code to register the fixed PHYs at the specified addresses for those to be usable. Get rid of it and use the new of_phy_is_fixed_link() plus of_phy_register_fixed_link() helpers to transition over the new scheme. Signed-off-by: Florian Fainelli --- No changes in v2 drivers/net/ethernet/freescale/gianfar.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/freescale/gianfar.c b/drivers/net/ethernet/freescale/gianfar.c index e2d42475b006..282674027c92 100644 --- a/drivers/net/ethernet/freescale/gianfar.c +++ b/drivers/net/ethernet/freescale/gianfar.c @@ -889,6 +889,17 @@ static int gfar_of_init(struct platform_device *ofdev, struct net_device **pdev) priv->phy_node = of_parse_phandle(np, "phy-handle", 0); + /* In the case of a fixed PHY, the DT node associated + * to the PHY is the Ethernet MAC DT node. + */ + if (of_phy_is_fixed_link(np)) { + err = of_phy_register_fixed_link(np); + if (err) + goto err_grp_init; + + priv->phy_node = np; + } + /* Find the TBI PHY. If it's not there, we don't support SGMII */ priv->tbi_node = of_parse_phandle(np, "tbi-handle", 0); @@ -1660,9 +1671,6 @@ static int init_phy(struct net_device *dev) priv->phydev = of_phy_connect(dev, priv->phy_node, &adjust_link, 0, interface); - if (!priv->phydev) - priv->phydev = of_phy_connect_fixed_link(dev, &adjust_link, - interface); if (!priv->phydev) { dev_err(&dev->dev, "could not attach to PHY\n"); return -ENODEV;