From patchwork Thu May 22 16:47: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: 351560 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3718214007B for ; Fri, 23 May 2014 02:51:09 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753214AbaEVQvE (ORCPT ); Thu, 22 May 2014 12:51:04 -0400 Received: from mail-ig0-f170.google.com ([209.85.213.170]:46879 "EHLO mail-ig0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752989AbaEVQs1 (ORCPT ); Thu, 22 May 2014 12:48:27 -0400 Received: by mail-ig0-f170.google.com with SMTP id uy17so6454460igb.3 for ; Thu, 22 May 2014 09:48:27 -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=weO8ZUXTCpFHOFjQ51BwKPDFRR4uUT2UnY60plRY3lY=; b=Z9fvlscqWWX7KzxIuCpkf2bMoj1V+clmzJeZr+/Nejk03+GCpffgV1LD7bVUI7f7NT n/E8/m1o1U9zDfxHNuAlWydlJxYN5b101BdLKkiYYADD4+XakHUYSDImTBC7RownX7AZ A4mMNWXvVoLDYqe6wtBjxNUleeFfiVdH1Ey3cotClUx9A/JVUKKCZIycy1mJjk3D9/4E ZOJX9NV0PGjmCd7svUQOC2i24sByXfWeBgLXLWdiKRBlnG/fVN/R+YBqEf8Kq9rOcp63 wCz6iI8hun35irEbN2FxnhhELWReOOjh+hJbLSldmODcCM16/bbs/IXHWIFDJ6+orP6J Bnkw== X-Received: by 10.50.97.68 with SMTP id dy4mr16310igb.8.1400777306957; Thu, 22 May 2014 09:48:26 -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.25 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 22 May 2014 09:48:26 -0700 (PDT) From: Florian Fainelli To: netdev@vger.kernel.org Cc: davem@davemloft.net, Florian Fainelli , Pantelis Antoniou , Vitaly Bordug , Li Yang , Grant Likely , Sergei Shtylyov , Thomas Petazzoni , Aida Mynzhasova , Richard Cochran , Claudiu Manoil , devicetree@vger.kernel.org (open list:OPEN FIRMWARE AND...), linux-kernel@vger.kernel.org (open list), linuxppc-dev@lists.ozlabs.org (open list:LINUX FOR POWERPC...) Subject: [PATCH net-next v2 7/9] ucc_geth: use the new fixed PHY helpers Date: Thu, 22 May 2014 09:47:49 -0700 Message-Id: <1400777271-32199-8-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> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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/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);