From patchwork Tue May 20 00:56:18 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 350454 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 4912914008B for ; Tue, 20 May 2014 10:59:40 +1000 (EST) Received: from ozlabs.org (ozlabs.org [103.22.144.67]) by lists.ozlabs.org (Postfix) with ESMTP id 37CA21A0BD7 for ; Tue, 20 May 2014 10:59:40 +1000 (EST) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from mail-yh0-x234.google.com (mail-yh0-x234.google.com [IPv6:2607:f8b0:4002:c01::234]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id D58101A088F for ; Tue, 20 May 2014 10:57:14 +1000 (EST) Received: by mail-yh0-f52.google.com with SMTP id z6so7477158yhz.39 for ; Mon, 19 May 2014 17:57:11 -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=UWa7Inl2WF4iLNsGjz6JVga58UXVn8xFIDM2rqxai1M=; b=hMQbxM/9mRstJeUUXpj0w3+AOZ0L6fPLH65MKqY9cG06I88MU8W96M4qF1YWit49Nc 8+V6plbFGNYj7GJn8F38/4KYINDW9PYqGtPZAgP8iXpjm8VxBJDpRa6RRW7SlF6gyCI2 b2+amSWQqTXLNlx0HYLQ3xZgv4chC4hs22SptTP3XR8JLh8unKvZHOMhHXmKadiFUwYh mkmb0COb0jzCV9BzzKalZpNMMDB/5ERFi7gdEZCTjv3t3IHb77yrRImLWeiEFMz+5ofT pwaJwfa3zG0SJFd2Mwx7uG4Yoo6Bpr+o2DnIpqpWC//KvkBVr7uJIAaeBh3jwLQCvV4E PApw== X-Received: by 10.236.36.45 with SMTP id v33mr10048357yha.129.1400547431456; Mon, 19 May 2014 17:57:11 -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 f2sm27506075yhc.41.2014.05.19.17.57.04 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 19 May 2014 17:57:06 -0700 (PDT) From: Florian Fainelli To: netdev@vger.kernel.org Subject: [PATCH net-next 3/9] net: bcmgenet: use the new fixed PHY helpers Date: Mon, 19 May 2014 17:56:18 -0700 Message-Id: <1400547384-11363-4-git-send-email-f.fainelli@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1400547384-11363-1-git-send-email-f.fainelli@gmail.com> References: <1400547384-11363-1-git-send-email-f.fainelli@gmail.com> Cc: Mark Rutland , "open list:DOCUMENTATION" , Paul Mackerras , Florian Fainelli , Claudiu Manoil , Grant Likely , "open list:OPEN FIRMWARE AND..." , Pawel Moll , Ian Campbell , Richard Cochran , Rob Herring , Aida Mynzhasova , Thomas Petazzoni , Sergei Shtylyov , Randy Dunlap , open list , davem@davemlof.net, Vitaly Bordug , Kumar Gala , "open list:LINUX FOR POWERPC..." , "David S. Miller" 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/broadcom/genet/bcmmii.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/drivers/net/ethernet/broadcom/genet/bcmmii.c b/drivers/net/ethernet/broadcom/genet/bcmmii.c index 4608673beaff..add8d8596084 100644 --- a/drivers/net/ethernet/broadcom/genet/bcmmii.c +++ b/drivers/net/ethernet/broadcom/genet/bcmmii.c @@ -298,6 +298,7 @@ int bcmgenet_mii_config(struct net_device *dev) static int bcmgenet_mii_probe(struct net_device *dev) { struct bcmgenet_priv *priv = netdev_priv(dev); + struct device_node *dn = priv->pdev->dev.of_node; struct phy_device *phydev; unsigned int phy_flags; int ret; @@ -307,15 +308,19 @@ static int bcmgenet_mii_probe(struct net_device *dev) return 0; } - if (priv->phy_dn) - phydev = of_phy_connect(dev, priv->phy_dn, - bcmgenet_mii_setup, 0, - priv->phy_interface); - else - phydev = of_phy_connect_fixed_link(dev, - bcmgenet_mii_setup, - priv->phy_interface); + /* 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(dn)) { + ret = of_phy_register_fixed_link(dn); + if (ret) + return ret; + + priv->phy_dn = dn; + } + phydev = of_phy_connect(dev, priv->phy_dn, bcmgenet_mii_setup, 0, + priv->phy_interface); if (!phydev) { pr_err("could not attach to PHY\n"); return -ENODEV;