]> www.infradead.org Git - users/jedix/linux-maple.git/commit
net: sfp: Add helper to return the SFP bus name
authorMaxime Chevallier <maxime.chevallier@bootlin.com>
Wed, 21 Aug 2024 15:09:58 +0000 (17:09 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 23 Aug 2024 12:04:34 +0000 (13:04 +0100)
commit0a2f7de0f3b96c4a30e56d2c79f8d812f89599a1
treeb832b201de1e60accc9aed5e89535c37ed6e61e7
parentb2db6f4ace72e71fa09b8d1354f8ac9854140d74
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.

This call will always be made while holding the RTNL which ensures
that the SFP driver won't unbind from the device. The returned pointer
to the bus name will only be used while RTNL is held.

Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Suggested-by: "Russell King (Oracle)" <linux@armlinux.org.uk>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Tested-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/sfp-bus.c
include/linux/sfp.h