Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2769772imj; Mon, 11 Feb 2019 08:12:05 -0800 (PST) X-Google-Smtp-Source: AHgI3IZpQOyYIzwll2D/5HLsO+Ac0sJcWq3ToWLcBQUP81gKreNCG8oMrWonngB6Qntce0JLyKWv X-Received: by 2002:a62:931a:: with SMTP id b26mr38766685pfe.65.1549901525349; Mon, 11 Feb 2019 08:12:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549901525; cv=none; d=google.com; s=arc-20160816; b=ENk/1gT0HhlaUgW9mLJ9ZvnmZmb8Svk1kkbGEIoobxC9D9/MmvUfuFUXrhYEjCN47+ AnZYX+HoEV3XHxbSf1cknOZcnb3gkpeuxkOMCvje6izntD60Fg37qNEHuFOiSitbkKaZ ystZHFwVwnj15GbmNe3Htrz7bFlUGttSzOCSd7wNA4Puk83IY1Ji9oU/a3nlvO5JLlRu Xoy81KtjHgqM9CM6SyEdgpvVMtZtGc3TDUGaHfTWj3qRdvp2wyficKSydaIRukUtM8S4 AiW6EEDd5FE8hQunoeBK0a8hdgYwcO1xAT144ozgCjjPoJMy3lpuizbnATOENCbxW1hn Funw== 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=RatX+UiO31YWtmlOG88vhSkr1yCghodoXvVyXhZMwlE=; b=Pnrr2+Wn7a7k05xKDtTQfmnPYRYuJzFSFwT1I//4XPjRWhLIt8q1oV8PlL0uWg8yjP DJII5ubXQYGdX6z+6yHAmVbhH77wE5JaSm5Ebfakg37iYii/Vuaa0elRgJ209JC2rlV5 Xi+T8MztvLxRI1+bPvhxHb8f/VIooQwGE0WDdQ3KELMrkTVx6bTsdNQcoN0iSHufAtQd 9JAvysjfMAoosqiwwrer11dSBfR2f5CeqMWUiaE0bKd7j56G7RN7Xbdx5eYGutBJWls4 DDLeI+i1Z8oTwqZLgjn9Zm56nGdZ96U1KeZSMpa1enlRSZgDOcY4ihe3nK2vbhmdw5e5 o1rA== 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 c10si1056925pls.271.2019.02.11.08.11.49; Mon, 11 Feb 2019 08:12:05 -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 S1730656AbfBKQKt (ORCPT + 99 others); Mon, 11 Feb 2019 11:10:49 -0500 Received: from relay1-d.mail.gandi.net ([217.70.183.193]:32839 "EHLO relay1-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727996AbfBKOZv (ORCPT ); Mon, 11 Feb 2019 09:25:51 -0500 X-Originating-IP: 90.88.22.177 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 relay1-d.mail.gandi.net (Postfix) with ESMTPSA id 48994240011; Mon, 11 Feb 2019 14:25:47 +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 2/4] net: phy: Move of_set_phy_eee_broken to phy-core.c Date: Mon, 11 Feb 2019 15:25:27 +0100 Message-Id: <20190211142529.22885-3-maxime.chevallier@bootlin.com> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20190211142529.22885-1-maxime.chevallier@bootlin.com> References: <20190211142529.22885-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 Reviewed-by: Andrew Lunn --- 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 855abf487279..de58a59815d5 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 65e18293d8e5..626f0527f36a 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"); @@ -2094,33 +2093,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 20344c7744d8..1a1d93a2a906 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h @@ -674,6 +674,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