diff options
| author | Maxime Chevallier <maxime.chevallier@bootlin.com> | 2023-12-21 21:00:37 +0300 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2024-01-01 21:38:56 +0300 |
| commit | dedd702a35793ab462fce4c737eeba0badf9718e (patch) | |
| tree | 6e8852ae74ba33123aec0b981887511206943053 /include | |
| parent | 034fcc210349b873ece7356905be5c6ca11eef2a (diff) | |
| download | linux-dedd702a35793ab462fce4c737eeba0badf9718e.tar.xz | |
net: sfp: Add helper to return the SFP bus name
Knowing the bus name is helpful when we want to expose the link topology
to userspace, add a helper to return the SFP bus name.
Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/sfp.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/sfp.h b/include/linux/sfp.h index 0573e53b0c11..55c0ab17c9e2 100644 --- a/include/linux/sfp.h +++ b/include/linux/sfp.h @@ -570,6 +570,7 @@ struct sfp_bus *sfp_bus_find_fwnode(const struct fwnode_handle *fwnode); int sfp_bus_add_upstream(struct sfp_bus *bus, void *upstream, const struct sfp_upstream_ops *ops); void sfp_bus_del_upstream(struct sfp_bus *bus); +const char *sfp_get_name(struct sfp_bus *bus); #else static inline int sfp_parse_port(struct sfp_bus *bus, const struct sfp_eeprom_id *id, @@ -648,6 +649,11 @@ static inline int sfp_bus_add_upstream(struct sfp_bus *bus, void *upstream, static inline void sfp_bus_del_upstream(struct sfp_bus *bus) { } + +static inline const char *sfp_get_name(struct sfp_bus *bus) +{ + return NULL; +} #endif #endif |
