summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@armlinux.org.uk>2020-01-31 15:45:13 +0000
committerRussell King (Oracle) <rmk+kernel@armlinux.org.uk>2024-05-09 18:18:07 +0100
commitf8eb66da8bdd436e1ec0852d40c81ccd38049ac6 (patch)
tree7637a39adf062bd0956dcd14f8c624f1bc07c7ad
parent34a4bbd9e2e4a039f1b486fa1ba040dc3483f7a5 (diff)
net: sfp: clean up sfp-bus building
Use a Kconfig symbol to control the build of sfp-bus.c Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
-rw-r--r--drivers/net/phy/Kconfig4
-rw-r--r--drivers/net/phy/Makefile3
-rw-r--r--include/linux/sfp.h2
3 files changed, 6 insertions, 3 deletions
diff --git a/drivers/net/phy/Kconfig b/drivers/net/phy/Kconfig
index 9e2672800f0b..8ac5a4fb1181 100644
--- a/drivers/net/phy/Kconfig
+++ b/drivers/net/phy/Kconfig
@@ -68,11 +68,15 @@ config RUST_PHYLIB_ABSTRACTIONS
Adds support needed for PHY drivers written in Rust. It provides
a wrapper around the C phylib core.
+config SFP_BUS
+ bool
+
config SFP
tristate "SFP cage support"
depends on I2C && PHYLINK
depends on HWMON || HWMON=n
select MDIO_I2C
+ select SFP_BUS
comment "MII PHY device drivers"
diff --git a/drivers/net/phy/Makefile b/drivers/net/phy/Makefile
index dc4c583f7e00..355ecd213761 100644
--- a/drivers/net/phy/Makefile
+++ b/drivers/net/phy/Makefile
@@ -29,8 +29,7 @@ obj-$(CONFIG_PHYLIB) += libphy.o
obj-$(CONFIG_NETWORK_PHY_TIMESTAMPING) += mii_timestamper.o
obj-$(CONFIG_SFP) += sff.o sfp.o
-sfp-obj-$(CONFIG_SFP) += sfp-bus.o
-obj-y += $(sfp-obj-y) $(sfp-obj-m)
+obj-$(CONFIG_SFP_BUS) += sfp-bus.o
obj-$(CONFIG_ADIN_PHY) += adin.o
obj-$(CONFIG_ADIN1100_PHY) += adin1100.o
diff --git a/include/linux/sfp.h b/include/linux/sfp.h
index a45da7eef9a2..c0cb8e8f7d07 100644
--- a/include/linux/sfp.h
+++ b/include/linux/sfp.h
@@ -547,7 +547,7 @@ struct sfp_upstream_ops {
void (*disconnect_phy)(void *priv);
};
-#if IS_ENABLED(CONFIG_SFP)
+#if IS_ENABLED(CONFIG_SFP_BUS)
int sfp_parse_port(struct sfp_bus *bus, const struct sfp_eeprom_id *id,
unsigned long *support);
bool sfp_may_have_phy(struct sfp_bus *bus, const struct sfp_eeprom_id *id);