Message ID | 20240206112527.4132299-1-vladimir.oltean@nxp.com (mailing list archive) |
---|---|
State | Accepted |
Commit | a2e520643be18cf69ec06558f3409f6c6559dce1 |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [net-next] net: dsa: b53: unexport and move b53_eee_enable_set() | expand |
On Tue, Feb 06, 2024 at 01:25:27PM +0200, Vladimir Oltean wrote: > After commit f86ad77faf24 ("net: dsa: bcm_sf2: Utilize b53_{enable, > disable}_port"), bcm_sf2.c no longer calls b53_eee_enable_set(), and all > its callers are in b53_common.c. > > We also need to move it, because it is called within b53_common.c before > its definition, and we want to avoid forward declarations. > > Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Reviewed-by: Simon Horman <horms@kernel.org>
On 2/6/24 03:25, Vladimir Oltean wrote: > After commit f86ad77faf24 ("net: dsa: bcm_sf2: Utilize b53_{enable, > disable}_port"), bcm_sf2.c no longer calls b53_eee_enable_set(), and all > its callers are in b53_common.c. > > We also need to move it, because it is called within b53_common.c before > its definition, and we want to avoid forward declarations. > > Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Acked-by: Florian Fainelli <florian.fainelli@broadcom.com>
Hello: This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <kuba@kernel.org>: On Tue, 6 Feb 2024 13:25:27 +0200 you wrote: > After commit f86ad77faf24 ("net: dsa: bcm_sf2: Utilize b53_{enable, > disable}_port"), bcm_sf2.c no longer calls b53_eee_enable_set(), and all > its callers are in b53_common.c. > > We also need to move it, because it is called within b53_common.c before > its definition, and we want to avoid forward declarations. > > [...] Here is the summary with links: - [net-next] net: dsa: b53: unexport and move b53_eee_enable_set() https://git.kernel.org/netdev/net-next/c/a2e520643be1 You are awesome, thank you!
diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c index 9e4c9bd6abcc..b2eeff04f4c8 100644 --- a/drivers/net/dsa/b53/b53_common.c +++ b/drivers/net/dsa/b53/b53_common.c @@ -559,6 +559,19 @@ static void b53_port_set_learning(struct b53_device *dev, int port, b53_write16(dev, B53_CTRL_PAGE, B53_DIS_LEARNING, reg); } +static void b53_eee_enable_set(struct dsa_switch *ds, int port, bool enable) +{ + struct b53_device *dev = ds->priv; + u16 reg; + + b53_read16(dev, B53_EEE_PAGE, B53_EEE_EN_CTRL, ®); + if (enable) + reg |= BIT(port); + else + reg &= ~BIT(port); + b53_write16(dev, B53_EEE_PAGE, B53_EEE_EN_CTRL, reg); +} + int b53_enable_port(struct dsa_switch *ds, int port, struct phy_device *phy) { struct b53_device *dev = ds->priv; @@ -2193,21 +2206,6 @@ void b53_mirror_del(struct dsa_switch *ds, int port, } EXPORT_SYMBOL(b53_mirror_del); -void b53_eee_enable_set(struct dsa_switch *ds, int port, bool enable) -{ - struct b53_device *dev = ds->priv; - u16 reg; - - b53_read16(dev, B53_EEE_PAGE, B53_EEE_EN_CTRL, ®); - if (enable) - reg |= BIT(port); - else - reg &= ~BIT(port); - b53_write16(dev, B53_EEE_PAGE, B53_EEE_EN_CTRL, reg); -} -EXPORT_SYMBOL(b53_eee_enable_set); - - /* Returns 0 if EEE was not enabled, or 1 otherwise */ int b53_eee_init(struct dsa_switch *ds, int port, struct phy_device *phy) diff --git a/drivers/net/dsa/b53/b53_priv.h b/drivers/net/dsa/b53/b53_priv.h index c26a03755e83..c13a907947f1 100644 --- a/drivers/net/dsa/b53/b53_priv.h +++ b/drivers/net/dsa/b53/b53_priv.h @@ -395,7 +395,6 @@ void b53_mirror_del(struct dsa_switch *ds, int port, int b53_enable_port(struct dsa_switch *ds, int port, struct phy_device *phy); void b53_disable_port(struct dsa_switch *ds, int port); void b53_brcm_hdr_setup(struct dsa_switch *ds, int port); -void b53_eee_enable_set(struct dsa_switch *ds, int port, bool enable); int b53_eee_init(struct dsa_switch *ds, int port, struct phy_device *phy); int b53_get_mac_eee(struct dsa_switch *ds, int port, struct ethtool_keee *e); int b53_set_mac_eee(struct dsa_switch *ds, int port, struct ethtool_keee *e);
After commit f86ad77faf24 ("net: dsa: bcm_sf2: Utilize b53_{enable, disable}_port"), bcm_sf2.c no longer calls b53_eee_enable_set(), and all its callers are in b53_common.c. We also need to move it, because it is called within b53_common.c before its definition, and we want to avoid forward declarations. Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> --- drivers/net/dsa/b53/b53_common.c | 28 +++++++++++++--------------- drivers/net/dsa/b53/b53_priv.h | 1 - 2 files changed, 13 insertions(+), 16 deletions(-)