From patchwork Tue May 20 00:56:20 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 350456 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 B891C14008B for ; Tue, 20 May 2014 11:01:08 +1000 (EST) Received: from ozlabs.org (ozlabs.org [103.22.144.67]) by lists.ozlabs.org (Postfix) with ESMTP id A2F541A0E01 for ; Tue, 20 May 2014 11:01:08 +1000 (EST) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from mail-yh0-x22f.google.com (mail-yh0-x22f.google.com [IPv6:2607:f8b0:4002: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 E0E111A087D for ; Tue, 20 May 2014 10:57:21 +1000 (EST) Received: by mail-yh0-f47.google.com with SMTP id z6so7503813yhz.6 for ; Mon, 19 May 2014 17:57:18 -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=jRH/0LjdvcXIhc3Iq6pQvV9iSKkfqUnJlxpeGxpAO1k=; b=ExOD1eZhYDWbLAIAqh2Qhg0A7B17Nyv4UGBPcepq73RORzP0YqAefoVyFhLe61xueT yNERHVK//Te+DM3QC16xi8HwAiLpaldxHI6seRiyIVLVRpgZqS5GeuZSCSoSU4PZIGZ6 6Fm7PCTewLoA/ujuQecGjU8IG+65qUhYX6l9Tms10J998d9eMEIRVUoSuEz8rd+zKXvU ixcShvFGPoi4XY646C+XiX+3AicbcSZF5DFILP/PhDig8B24wKPDQkEibegdSIy5n+sT jP3kfZiSmm2DUhsiob/YSzOEeZm9rGFbUlS++HikNeCFtlJWPtoeJd7/OdxAGxBEuUZ5 +2qg== X-Received: by 10.236.1.36 with SMTP id 24mr49769607yhc.45.1400547438536; Mon, 19 May 2014 17:57:18 -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.15 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 19 May 2014 17:57:17 -0700 (PDT) From: Florian Fainelli To: netdev@vger.kernel.org Subject: [PATCH net-next 5/9] fs_enet: use the new fixed PHY helpers Date: Mon, 19 May 2014 17:56:20 -0700 Message-Id: <1400547384-11363-6-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/freescale/fs_enet/fs_enet-main.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c b/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c index dc80db41d6b3..d602711e00e9 100644 --- a/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c +++ b/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c @@ -792,10 +792,6 @@ static int fs_init_phy(struct net_device *dev) phydev = of_phy_connect(dev, fep->fpi->phy_node, &fs_adjust_link, 0, iface); if (!phydev) { - phydev = of_phy_connect_fixed_link(dev, &fs_adjust_link, - iface); - } - if (!phydev) { dev_err(&dev->dev, "Could not attach to PHY\n"); return -ENODEV; } @@ -1029,9 +1025,15 @@ static int fs_enet_probe(struct platform_device *ofdev) fpi->use_napi = 1; fpi->napi_weight = 17; fpi->phy_node = of_parse_phandle(ofdev->dev.of_node, "phy-handle", 0); - if ((!fpi->phy_node) && (!of_get_property(ofdev->dev.of_node, "fixed-link", - NULL))) - goto out_free_fpi; + if (!fpi->phy_node) { + if (of_phy_is_fixed_link(ofdev->dev.of_node)) { + err = of_phy_register_fixed_link(ofdev->dev.of_node); + if (err) + goto out_free_fpi; + + fpi->phy_node = ofdev->dev.of_node; + } + } if (of_device_is_compatible(ofdev->dev.of_node, "fsl,mpc5125-fec")) { phy_connection_type = of_get_property(ofdev->dev.of_node,