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-02-16 11:02:01 +0000
commit9b20712ef8f25bfb9ece0fccea8f2022af5409f3 (patch)
tree050e421781c3bc25173dcdb246ae3b2e33f55667
parent481d72d919056963ee4357a06839641c3d8807f0 (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 15828f4710a9..521b36512894 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 7b417477fde7..ac0c2ab90467 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);