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>2022-01-18 10:19:16 +0000
commit08650d8b10b8a69f356808b90aa2e5f8ac692898 (patch)
tree52bddc4b9370ce07baf21a22d14ebc930872e285
parent265468cb45080b29562b5db661112fecaa4588da (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 902495afcb38..dbd5ccbd3fbd 100644
--- a/drivers/net/phy/Kconfig
+++ b/drivers/net/phy/Kconfig
@@ -55,11 +55,15 @@ config FIXED_PHY
Currently tested with mpc866ads and mpc8349e-mitx.
+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 48733fb58dcb..08ba7c745f7f 100644
--- a/drivers/net/phy/Makefile
+++ b/drivers/net/phy/Makefile
@@ -27,8 +27,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_AMD_PHY) += amd.o
diff --git a/include/linux/sfp.h b/include/linux/sfp.h
index d1f343853b6c..26eacf6fa46f 100644
--- a/include/linux/sfp.h
+++ b/include/linux/sfp.h
@@ -530,7 +530,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);