summaryrefslogtreecommitdiff
path: root/drivers/net/phy/Makefile
diff options
context:
space:
mode:
authorFlorian Fainelli <f.fainelli@gmail.com>2017-03-23 10:01:19 -0700
committerDavid S. Miller <davem@davemloft.net>2017-03-24 12:51:05 -0700
commit90eff9096c01ba90cdae504a6b95ee87fe2556a3 (patch)
tree2e8b75015ca154e15d796308b3e8c40333dc65f8 /drivers/net/phy/Makefile
parent17487eebaf5799f7a2e78364cc94fb84e37300a2 (diff)
net: phy: Allow splitting MDIO bus/device support from PHYs
Introduce a new configuration symbol: MDIO_DEVICE which allows building the MDIO devices and bus code, without pulling in the entire Ethernet PHY library and devices code. PHYLIB nows select MDIO_DEVICE and the relevant Makefile files are updated to reflect that. When MDIO_DEVICE (MDIO bus/device only) is selected, but not PHYLIB, we have mdio-bus.ko as a loadable module, and it does not have a module_exit() function because the safety of removing a bus class is unclear. When both MDIO_DEVICE and PHYLIB are enabled, we need to assemble everything into a common loadable module: libphy.ko because of nasty circular dependencies between phy.c, phy_device.c and mdio_bus.c which are really tough to untangle. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/phy/Makefile')
-rw-r--r--drivers/net/phy/Makefile13
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/net/phy/Makefile b/drivers/net/phy/Makefile
index 82d915614646..0e1ec0438c23 100644
--- a/drivers/net/phy/Makefile
+++ b/drivers/net/phy/Makefile
@@ -1,7 +1,16 @@
# Makefile for Linux PHY drivers and MDIO bus drivers
-libphy-y := phy.o phy_device.o mdio_bus.o mdio_device.o \
- mdio-boardinfo.o phy-core.o
+libphy-y := phy.o phy-core.o phy_device.o
+mdio-bus-y += mdio_bus.o mdio_device.o mdio-boardinfo.o
+
+# PHYLIB implies MDIO_DEVICE, in that case, we have a bunch of circular
+# dependencies that does not make it possible to split mdio-bus objects into a
+# dedicated loadable module, so we bundle them all together into libphy.ko
+ifdef CONFIG_PHYLIB
+libphy-y += $(mdio-bus-y)
+else
+obj-$(CONFIG_MDIO_DEVICE) += mdio-bus.o
+endif
libphy-$(CONFIG_SWPHY) += swphy.o
libphy-$(CONFIG_LED_TRIGGER_PHY) += phy_led_triggers.o