From bfec4649bf25737160c8e5952fb02fcf65361870 Mon Sep 17 00:00:00 2001 From: Russell King Date: Fri, 31 Jan 2020 15:45:13 +0000 Subject: net: sfp: clean up sfp-bus building Use a Kconfig symbol to control the build of sfp-bus.c Signed-off-by: Russell King --- drivers/net/phy/Kconfig | 4 ++++ drivers/net/phy/Makefile | 3 +-- include/linux/sfp.h | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/net/phy/Kconfig b/drivers/net/phy/Kconfig index 1c5a10b672fc..f66d6e5aa650 100644 --- a/drivers/net/phy/Kconfig +++ b/drivers/net/phy/Kconfig @@ -288,11 +288,15 @@ config LED_TRIGGER_PHY comment "MII PHY device drivers" +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 config ADIN_PHY tristate "Analog Devices Industrial Ethernet PHYs" diff --git a/drivers/net/phy/Makefile b/drivers/net/phy/Makefile index ba9027d8a15b..f3bc627dd7f1 100644 --- a/drivers/net/phy/Makefile +++ b/drivers/net/phy/Makefile @@ -52,8 +52,7 @@ obj-$(CONFIG_MDIO_XPCS) += mdio-xpcs.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 2da1a5181779..fe9af556899f 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); -- cgit