From patchwork Fri Sep 6 15:18:21 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 273220 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 47BA52C0107 for ; Sat, 7 Sep 2013 01:18:42 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755014Ab3IFPSh (ORCPT ); Fri, 6 Sep 2013 11:18:37 -0400 Received: from top.free-electrons.com ([176.31.233.9]:41904 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753581Ab3IFPS1 (ORCPT ); Fri, 6 Sep 2013 11:18:27 -0400 Received: by mail.free-electrons.com (Postfix, from userid 106) id D9877947; Fri, 6 Sep 2013 17:18:27 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on mail.free-electrons.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.3.2 Received: from localhost (col31-4-88-188-83-94.fbx.proxad.net [88.188.83.94]) by mail.free-electrons.com (Postfix) with ESMTPSA id 74E85845; Fri, 6 Sep 2013 17:18:27 +0200 (CEST) From: Thomas Petazzoni To: "David S. Miller" , netdev@vger.kernel.org, devicetree@vger.kernel.org Cc: Florian Fainelli , Lior Amsalem , Gregory Clement , Ezequiel Garcia , linux-arm-kernel@lists.infradead.org, Mark Rutland , Sascha Hauer , Christian Gmeiner Subject: [RFC PATCHv2 4/4] net: mvneta: add support for fixed links Date: Fri, 6 Sep 2013 17:18:21 +0200 Message-Id: <1378480701-12908-5-git-send-email-thomas.petazzoni@free-electrons.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1378480701-12908-1-git-send-email-thomas.petazzoni@free-electrons.com> References: <1378480701-12908-1-git-send-email-thomas.petazzoni@free-electrons.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Following the introduction of of_phy_register_fixed_link(), this patch introduces fixed link support in the mvneta driver, for Marvell Armada 370/XP SOCs. Signed-off-by: Thomas Petazzoni --- .../devicetree/bindings/net/marvell-armada-370-neta.txt | 4 ++-- drivers/net/ethernet/marvell/mvneta.c | 10 ++++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Documentation/devicetree/bindings/net/marvell-armada-370-neta.txt b/Documentation/devicetree/bindings/net/marvell-armada-370-neta.txt index 859a6fa..4d07d4e 100644 --- a/Documentation/devicetree/bindings/net/marvell-armada-370-neta.txt +++ b/Documentation/devicetree/bindings/net/marvell-armada-370-neta.txt @@ -4,8 +4,8 @@ Required properties: - compatible: should be "marvell,armada-370-neta". - reg: address and length of the register set for the device. - interrupts: interrupt for the device -- phy: A phandle to a phy node defining the PHY address (as the reg - property, a single integer). +- phy: A phandle to the PHY node describing the PHY to which this + Ethernet controller is connected to. - phy-mode: The interface between the SoC and the PHY (a string that of_get_phy_mode() can understand) - clocks: a pointer to the reference clock for this device. diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c index b017818..6da1516 100644 --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c @@ -2711,10 +2711,12 @@ static int mvneta_probe(struct platform_device *pdev) } phy_node = of_parse_phandle(dn, "phy", 0); - if (!phy_node) { - dev_err(&pdev->dev, "no associated PHY\n"); - err = -ENODEV; - goto err_free_irq; + if (of_phy_is_fixed_link(phy_node)) { + err = of_phy_register_fixed_link(phy_node); + if (err < 0) { + dev_err(&pdev->dev, "cannot register fixed PHY\n"); + goto err_free_irq; + } } phy_mode = of_get_phy_mode(dn);