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>2025-04-04 15:00:19 +0100
commit5e5a08dcf2dbe2cb864a9226f1383a1876352983 (patch)
tree2c81c413117ce45be84a458876ed044518257c34
parentb4f923b16455558ab720b520cd757f90b1762994 (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 41c15a2c2037..e630c6251a45 100644
--- a/drivers/net/phy/Kconfig
+++ b/drivers/net/phy/Kconfig
@@ -71,11 +71,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 b15e2ac8d3a2..0a3c123f58d4 100644
--- a/drivers/net/phy/Makefile
+++ b/drivers/net/phy/Makefile
@@ -30,8 +30,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 60c65cea74f6..9eb83b19e001 100644
--- a/include/linux/sfp.h
+++ b/include/linux/sfp.h
@@ -553,7 +553,7 @@ struct sfp_upstream_ops {
void (*disconnect_phy)(void *priv, struct phy_device *);
};
-#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);