From patchwork Thu May 22 16:47:45 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 351561 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 D1CBA14008A for ; Fri, 23 May 2014 02:51:24 +1000 (EST) Received: from ozlabs.org (ozlabs.org [103.22.144.67]) by lists.ozlabs.org (Postfix) with ESMTP id BD3601A0BFF for ; Fri, 23 May 2014 02:51:24 +1000 (EST) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from mail-ie0-x22c.google.com (mail-ie0-x22c.google.com [IPv6:2607:f8b0:4001:c03::22c]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id DC6A31A0605 for ; Fri, 23 May 2014 02:48:20 +1000 (EST) Received: by mail-ie0-f172.google.com with SMTP id tp5so3866339ieb.3 for ; Thu, 22 May 2014 09:48:17 -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=HKHfL5sLckbxi7GmwyUUtFOv7bYwEHnjeOt5HiIuuu8=; b=PPcJyJrVtyslvxFbBZg0ZN0aORXCkHvOdMWXlx82Ec8ELj2LLmsdIRHbFLwjP/voUu 8aVjACtFCR2aIDKGc+Q1BHN+FHon4Zvxw1uIDdQK4qJ0ACSOwhVQbOQ4inyEtlAKCy/4 9TuU3UIHQWY/pnk7PnhL0oZU+C2+qPuDHAY++CXb6UJyHNthvTuRmPzQMXQrtvbVxtqq FzCAIlelJxF8xiDwpApiVblz36lEwT+lwkcL3x4GXvn6vaLSUxV/1vbN9kivjnOVwX9Z R/yzUSxFA0wpBvEWF3JLlolcv/fv9FY72WrvgTmKZTqJB1vnN3tKRV5X23u8T+5So1FQ 52MQ== X-Received: by 10.42.208.8 with SMTP id ga8mr56714393icb.55.1400777297848; Thu, 22 May 2014 09:48:17 -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.15 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 22 May 2014 09:48:17 -0700 (PDT) From: Florian Fainelli To: netdev@vger.kernel.org Subject: [PATCH net-next v2 3/9] net: bcmgenet: use the new fixed PHY helpers Date: Thu, 22 May 2014 09:47:45 -0700 Message-Id: <1400777271-32199-4-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/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;