diff options
author | Russell King (Oracle) <rmk+kernel@armlinux.org.uk> | 2024-02-01 11:38:04 +0000 |
---|---|---|
committer | Russell King (Oracle) <rmk+kernel@armlinux.org.uk> | 2024-04-10 20:25:35 +0100 |
commit | d3de3c9c35be06f6f2b13a6229836c2c06d537af (patch) | |
tree | cd0c8adff9a2d27fb36d9fe0857b5b467683aa7d /include | |
parent | fae957127a5a06fdd990dfc9b57ac7bff246a138 (diff) |
net: dsa: introduce dsa_phylink_to_port()
We convert from a phylink_config struct to a dsa_port struct in many
places, let's provide a helper for this.
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Diffstat (limited to 'include')
-rw-r--r-- | include/net/dsa.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/net/dsa.h b/include/net/dsa.h index 82135fbdb1e6..850404e2bcce 100644 --- a/include/net/dsa.h +++ b/include/net/dsa.h @@ -327,6 +327,12 @@ struct dsa_port { }; }; +static inline struct dsa_port * +dsa_phylink_to_port(struct phylink_config *config) +{ + return container_of(config, struct dsa_port, pl_config); +} + /* TODO: ideally DSA ports would have a single dp->link_dp member, * and no dst->rtable nor this struct dsa_link would be needed, * but this would require some more complex tree walking, |