From d0281a56b00c63ad51ebb550fba0351807475c47 Mon Sep 17 00:00:00 2001 From: Florian Fainelli Date: Tue, 28 Mar 2017 12:57:09 -0700 Subject: net: phy: Allow building mdio-boardinfo into the kernel mdio-boardinfo contains code that is helpful for platforms to register specific MDIO bus devices independent of how CONFIG_MDIO_DEVICE or CONFIG_PHYLIB will be selected (modular or built-in). In order to make that possible, let's do the following: - descend into drivers/net/phy/ unconditionally - make mdiobus_setup_mdiodev_from_board_info() take a callback argument which allows us not to expose the internal MDIO board info list and mutex, yet maintain the logic within the same file - relocate the code that creates a MDIO device into drivers/net/phy/mdio_bus.c - build mdio-boardinfo.o into the kernel as soon as MDIO_DEVICE is defined (y or m) Fixes: 90eff9096c01 ("net: phy: Allow splitting MDIO bus/device support from PHYs") Fixes: 648ea0134069 ("net: phy: Allow pre-declaration of MDIO devices") Signed-off-by: Florian Fainelli Tested-by: Arnd Bergmann Signed-off-by: David S. Miller --- drivers/net/phy/Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'drivers/net/phy/Makefile') diff --git a/drivers/net/phy/Makefile b/drivers/net/phy/Makefile index 0e1ec0438c23..e36db9a2ba38 100644 --- a/drivers/net/phy/Makefile +++ b/drivers/net/phy/Makefile @@ -1,7 +1,11 @@ # Makefile for Linux PHY drivers and MDIO bus drivers libphy-y := phy.o phy-core.o phy_device.o -mdio-bus-y += mdio_bus.o mdio_device.o mdio-boardinfo.o +mdio-bus-y += mdio_bus.o mdio_device.o + +ifdef CONFIG_MDIO_DEVICE +obj-y += mdio-boardinfo.o +endif # 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 -- cgit