Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp140797imj; Thu, 7 Feb 2019 01:50:45 -0800 (PST) X-Google-Smtp-Source: AHgI3IbuP7DRlHnyFLRb7YN6+osr2qLWpXPs47m7X68lL/17iKzrpQJrBt+us/rtjailR6lpZcvN X-Received: by 2002:a63:1013:: with SMTP id f19mr9319879pgl.38.1549533045032; Thu, 07 Feb 2019 01:50:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549533045; cv=none; d=google.com; s=arc-20160816; b=KWVU3tLHtwcI3axXRjbq+icNXmaqf3ZO7sEnT1VxH3uXSV1EmAMDpIbEwG0hyoiwyz 0WMDBWCi26LBLCTANT7eirZZDrta0PV2+n1VnPtZBICQ1FfGUrKKaP9Ix6qBepvA828g C1e1t1hKXSEWv00+LJFbb2WETxbTB0GLnHw0144AbMbHuRygu/gw+782a7hUtCaZmJwA a0zgttz71pCjGoXw7efKi6WcECXI6hEKOEKyqG/CyaDQ6fwjnBna8Ke8ttEHHAW+fwGv PMJvA0mVixFxZMzTKRZbkmMc2FBUOeCwCLzc0pCujjgOjrbC2YutjhERkzbzi5piki8K 9hhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=9C9sAqX9THc7vOEsNJCiu8Hc91AgEvEqRlQRwkFByow=; b=mGIxTo8Y6dwPRl2tg1mZOx4cTPesJQfD5mBXt8iqxzCCqCUH1SNm81hVZE6V18kdSx Eb7sFFIM6fUm8yfqHBBzDYU9S4g/9EypxH+O+Lf0E1KY5ig1e4s88QSgdbiaF5ipM/gd uetu7YD1i2NlcCBDcWS///i+rvDcKXV5ndigqph2PLS9tUcQfqaThD8pS/TrinI74/RY RXRi1eINPCav5dvvXw39Bzg8PgvMQQzBGPpjbhFkjqMgwPXlTwy/fnKvbullrI9h3ZzJ ZDagUS2Z80U5pgMoeUgZqfVxd48B8bR+SmPko2S2p9j27OL5uX4dzNMIxNwn+8UaoHGH bqTw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r16si6330230pgj.414.2019.02.07.01.50.29; Thu, 07 Feb 2019 01:50:45 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727074AbfBGJuK (ORCPT + 99 others); Thu, 7 Feb 2019 04:50:10 -0500 Received: from relay11.mail.gandi.net ([217.70.178.231]:47279 "EHLO relay11.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726983AbfBGJuH (ORCPT ); Thu, 7 Feb 2019 04:50:07 -0500 Received: from mc-bl-xps13.lan (aaubervilliers-681-1-80-177.w90-88.abo.wanadoo.fr [90.88.22.177]) (Authenticated sender: maxime.chevallier@bootlin.com) by relay11.mail.gandi.net (Postfix) with ESMTPSA id 9DA14100017; Thu, 7 Feb 2019 09:50:02 +0000 (UTC) From: Maxime Chevallier To: davem@davemloft.net Cc: Maxime Chevallier , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Andrew Lunn , Florian Fainelli , Heiner Kallweit , Russell King , linux-arm-kernel@lists.infradead.org, Antoine Tenart , thomas.petazzoni@bootlin.com, gregory.clement@bootlin.com, miquel.raynal@bootlin.com, nadavh@marvell.com, stefanc@marvell.com, mw@semihalf.com Subject: [PATCH net-next v2 03/10] net: phy: Move of_set_phy_eee_broken to phy-core.c Date: Thu, 7 Feb 2019 10:49:32 +0100 Message-Id: <20190207094939.27369-4-maxime.chevallier@bootlin.com> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20190207094939.27369-1-maxime.chevallier@bootlin.com> References: <20190207094939.27369-1-maxime.chevallier@bootlin.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since of_set_phy_supported was moved to phy-core.c, we can also move of_set_phy_eee_broken to the same location, so that we have all OF functions in the same place. This patch doesn't intend to introduce any change in behaviour. Signed-off-by: Maxime Chevallier --- drivers/net/phy/phy-core.c | 27 +++++++++++++++++++++++++++ drivers/net/phy/phy_device.c | 28 ---------------------------- include/linux/phy.h | 1 + 3 files changed, 28 insertions(+), 28 deletions(-) diff --git a/drivers/net/phy/phy-core.c b/drivers/net/phy/phy-core.c index 8e54fe396553..9429b473c791 100644 --- a/drivers/net/phy/phy-core.c +++ b/drivers/net/phy/phy-core.c @@ -383,6 +383,33 @@ void of_set_phy_supported(struct phy_device *phydev) __set_phy_supported(phydev, max_speed); } +void of_set_phy_eee_broken(struct phy_device *phydev) +{ + struct device_node *node = phydev->mdio.dev.of_node; + u32 broken = 0; + + if (!IS_ENABLED(CONFIG_OF_MDIO)) + return; + + if (!node) + return; + + if (of_property_read_bool(node, "eee-broken-100tx")) + broken |= MDIO_EEE_100TX; + if (of_property_read_bool(node, "eee-broken-1000t")) + broken |= MDIO_EEE_1000T; + if (of_property_read_bool(node, "eee-broken-10gt")) + broken |= MDIO_EEE_10GT; + if (of_property_read_bool(node, "eee-broken-1000kx")) + broken |= MDIO_EEE_1000KX; + if (of_property_read_bool(node, "eee-broken-10gkx4")) + broken |= MDIO_EEE_10GKX4; + if (of_property_read_bool(node, "eee-broken-10gkr")) + broken |= MDIO_EEE_10GKR; + + phydev->eee_broken_modes = broken; +} + /** * phy_resolve_aneg_linkmode - resolve the advertisements into phy settings * @phydev: The phy_device struct diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index a4ab16992806..a4cbc5a6f09d 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c @@ -30,7 +30,6 @@ #include #include #include -#include MODULE_DESCRIPTION("PHY library"); MODULE_AUTHOR("Andy Fleming"); @@ -2153,33 +2152,6 @@ bool phy_validate_pause(struct phy_device *phydev, } EXPORT_SYMBOL(phy_validate_pause); -static void of_set_phy_eee_broken(struct phy_device *phydev) -{ - struct device_node *node = phydev->mdio.dev.of_node; - u32 broken = 0; - - if (!IS_ENABLED(CONFIG_OF_MDIO)) - return; - - if (!node) - return; - - if (of_property_read_bool(node, "eee-broken-100tx")) - broken |= MDIO_EEE_100TX; - if (of_property_read_bool(node, "eee-broken-1000t")) - broken |= MDIO_EEE_1000T; - if (of_property_read_bool(node, "eee-broken-10gt")) - broken |= MDIO_EEE_10GT; - if (of_property_read_bool(node, "eee-broken-1000kx")) - broken |= MDIO_EEE_1000KX; - if (of_property_read_bool(node, "eee-broken-10gkx4")) - broken |= MDIO_EEE_10GKX4; - if (of_property_read_bool(node, "eee-broken-10gkr")) - broken |= MDIO_EEE_10GKR; - - phydev->eee_broken_modes = broken; -} - static bool phy_drv_supports_irq(struct phy_driver *phydrv) { return phydrv->config_intr && phydrv->ack_interrupt; diff --git a/include/linux/phy.h b/include/linux/phy.h index cfdd3de38410..017118061ecf 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h @@ -668,6 +668,7 @@ phy_lookup_setting(int speed, int duplex, const unsigned long *mask, size_t phy_speeds(unsigned int *speeds, size_t size, unsigned long *mask); void of_set_phy_supported(struct phy_device *phydev); +void of_set_phy_eee_broken(struct phy_device *phydev); static inline bool __phy_is_started(struct phy_device *phydev) { -- 2.19.2