From patchwork Wed May 21 21:38:49 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 351339 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id C80C6140088 for ; Thu, 22 May 2014 07:45:02 +1000 (EST) Received: from ozlabs.org (ozlabs.org [103.22.144.67]) by lists.ozlabs.org (Postfix) with ESMTP id B3CA61A0F94 for ; Thu, 22 May 2014 07:45:02 +1000 (EST) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from mail-pb0-x22f.google.com (mail-pb0-x22f.google.com [IPv6:2607:f8b0:400e:c01::22f]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id AD8521A0873 for ; Thu, 22 May 2014 07:39:18 +1000 (EST) Received: by mail-pb0-f47.google.com with SMTP id rp16so1803074pbb.20 for ; Wed, 21 May 2014 14:39:16 -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=5O6ErnpJTMZc2QUhOqylOUAHfp9F6vrKbT9MTOHhy2Q=; b=HgPacvhzavCIhpjh1pdwx6yOXlYuoaI2BGlCdNH2Qs/utE88ZWNZRngSYBZD5La9eB mAb+/IowcclwA9TL8Y7bDv0nDodrZgLdIOlbFhBA3ql4e8VusZlL+3Zz3CdiuorjXr60 rsqpqIsO/DUqSLo97z7LvpkrfvMffunm6WX7BzMvvuJxwyPWmwkomWZucJreJcTcxmaq plS+/zA//OrX76tktA78HTioQBysto2/8ecSJPJ+95mVEwIWsXeb97nYsEVYJB9jBBt6 nDDxDD25SQuMar7JknWUPf7H/tTuMvBEsSxV4Z/CrrooVY0NczZB8PsR8iSVCHqsCRTE 4XKg== X-Received: by 10.66.119.172 with SMTP id kv12mr62236095pab.34.1400708356131; Wed, 21 May 2014 14:39:16 -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 it4sm9655244pbc.39.2014.05.21.14.39.14 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 21 May 2014 14:39:15 -0700 (PDT) From: Florian Fainelli To: netdev@vger.kernel.org Subject: [PATCH RESEND net-next 7/9] ucc_geth: use the new fixed PHY helpers Date: Wed, 21 May 2014 14:38:49 -0700 Message-Id: <1400708331-18088-8-git-send-email-f.fainelli@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1400708331-18088-1-git-send-email-f.fainelli@gmail.com> References: <1400708331-18088-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 --- drivers/net/ethernet/freescale/ucc_geth.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/freescale/ucc_geth.c b/drivers/net/ethernet/freescale/ucc_geth.c index c8299c31b21f..fab39e295441 100644 --- a/drivers/net/ethernet/freescale/ucc_geth.c +++ b/drivers/net/ethernet/freescale/ucc_geth.c @@ -1728,9 +1728,6 @@ static int init_phy(struct net_device *dev) phydev = of_phy_connect(dev, ug_info->phy_node, &adjust_link, 0, priv->phy_interface); - if (!phydev) - phydev = of_phy_connect_fixed_link(dev, &adjust_link, - priv->phy_interface); if (!phydev) { dev_err(&dev->dev, "Could not attach to PHY\n"); return -ENODEV; @@ -3790,6 +3787,17 @@ static int ucc_geth_probe(struct platform_device* ofdev) ug_info->uf_info.irq = irq_of_parse_and_map(np, 0); ug_info->phy_node = of_parse_phandle(np, "phy-handle", 0); + if (!ug_info->phy_node) { + /* 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) + return err; + } + ug_info->phy_node = np; + } /* Find the TBI PHY node. If it's not there, we don't support SGMII */ ug_info->tbi_node = of_parse_phandle(np, "tbi-handle", 0);