diff options
author | Russell King (Oracle) <rmk+kernel@armlinux.org.uk> | 2024-04-10 21:42:38 +0200 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2024-04-12 05:01:14 +0200 |
commit | dd0c9855b41310470086500c9963bbb64bb90dd0 (patch) | |
tree | f4098e187a9818d6abe8d8977f9b4c5c12b7403c /include | |
parent | tls: remove redundant assignment to variable decrypted (diff) | |
download | linux-dd0c9855b41310470086500c9963bbb64bb90dd0.tar.xz linux-dd0c9855b41310470086500c9963bbb64bb90dd0.zip |
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>
Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
Link: https://lore.kernel.org/r/E1rudqA-006K9B-85@rmk-PC.armlinux.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
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 7c0da9effe4e..f228b479a5fd 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, |