From patchwork Mon Dec 1 19:55:59 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tim Gardner X-Patchwork-Id: 416547 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id 17E501400E7; Tue, 2 Dec 2014 06:56:27 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1XvX56-0006Te-29; Mon, 01 Dec 2014 19:56:24 +0000 Received: from mail-pd0-f178.google.com ([209.85.192.178]) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1XvX4w-0006RT-DC for kernel-team@lists.ubuntu.com; Mon, 01 Dec 2014 19:56:14 +0000 Received: by mail-pd0-f178.google.com with SMTP id g10so11606085pdj.9 for ; Mon, 01 Dec 2014 11:56:13 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=BwRJjJYEp4yz6G3WE4qwsFtEx7RoA9JQ6o+PJNq2Juc=; b=OjLaGs8JQk1Y78JLJHyg9T1FzITgdCA0PAcX8Gs3BZwCS1isbF8cDpXcTKxp2+f5HR AaxaX4bTjSwDm2Q7Q8mA3McCjymeZikd2AeDai0Sf9zdDNaAo+qlnWtbjoADQFJRxzT6 oDOjQe4xYKKzShkoAy6elQ63ZXysZsZgc+XtfCzJMXtCUxgtuUL/yl00r6NKh8078315 ivt+hdmNWHWoiGdau5+7zqFO9qs48utwlQEFJ04UV9929K/m1H+idNbf5PmqWMAM8xLl bN54VxBM4rnxVUObyKFOj5BAtBsoy9t6snGWK07wLW3vYJDGm/rNcqL+Rcik3mCs6TwU p5rQ== X-Gm-Message-State: ALoCoQmPjmwF4nJwayztEwv/TOy2NcQS23jattWqzz6sU2s+UdS7QdNQiTvudSCMuyTUov+nBMSq X-Received: by 10.70.40.197 with SMTP id z5mr64549474pdk.45.1417463773555; Mon, 01 Dec 2014 11:56:13 -0800 (PST) Received: from gbyte.rtg.local (host-174-45-39-7.hln-mt.client.bresnan.net. [174.45.39.7]) by mx.google.com with ESMTPSA id yl6sm18186497pbc.91.2014.12.01.11.56.12 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 01 Dec 2014 11:56:12 -0800 (PST) From: tim.gardner@canonical.com To: kernel-team@lists.ubuntu.com Subject: [PATCH 2/2 Trusty SRU] of: make of_get_phy_mode parse 'phy-connection-type' Date: Mon, 1 Dec 2014 12:55:59 -0700 Message-Id: <1417463759-19223-3-git-send-email-tim.gardner@canonical.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1417463759-19223-1-git-send-email-tim.gardner@canonical.com> References: <1417463759-19223-1-git-send-email-tim.gardner@canonical.com> X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.14 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: kernel-team-bounces@lists.ubuntu.com From: Florian Fainelli BugLink: http://bugs.launchpad.net/bugs/1381084 Per the ePAPR v1.1 specification, 'phy-connection-type' is the canonical property name for describing an Ethernet to PHY connection type. Make sure that of_get_phy_mode() also attempts to parse that property and update the comments mentioning 'phy-mode' to also include 'phy-connection-type'. Signed-off-by: Florian Fainelli Signed-off-by: Grant Likely (cherry picked from commit cf4c9eb5a451ba26246477dd3168e98b7a5c1b1c) Signed-off-by: Dann Frazier Signed-off-by: Tim Gardner --- drivers/of/of_net.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/of/of_net.c b/drivers/of/of_net.c index a208a45..a3df342 100644 --- a/drivers/of/of_net.c +++ b/drivers/of/of_net.c @@ -13,8 +13,8 @@ /** * It maps 'enum phy_interface_t' found in include/linux/phy.h - * into the device tree binding of 'phy-mode', so that Ethernet - * device driver can get phy interface from device tree. + * into the device tree binding of 'phy-mode' or 'phy-connection-type', + * so that Ethernet device driver can get phy interface from device tree. */ static const char *phy_modes[] = { [PHY_INTERFACE_MODE_NA] = "", @@ -37,8 +37,9 @@ static const char *phy_modes[] = { * of_get_phy_mode - Get phy mode for given device_node * @np: Pointer to the given device_node * - * The function gets phy interface string from property 'phy-mode', - * and return its index in phy_modes table, or errno in error case. + * The function gets phy interface string from property 'phy-mode' or + * 'phy-connection-type', and return its index in phy_modes table, or errno in + * error case. */ int of_get_phy_mode(struct device_node *np) { @@ -47,6 +48,8 @@ int of_get_phy_mode(struct device_node *np) err = of_property_read_string(np, "phy-mode", &pm); if (err < 0) + err = of_property_read_string(np, "phy-connection-type", &pm); + if (err < 0) return err; for (i = 0; i < ARRAY_SIZE(phy_modes); i++)