net: mscc: ocelot: rethink Kconfig dependencies again
Subsystems (4)
Vladimir Oltean
maintainerPATCH 1/1 net: mscc: ocelot: rethink Kconfig dependencies again
From: Vladimir Oltean <[email protected]>
Having the users of MSCC_OCELOT_SWITCH_LIB depend on REGMAP_MMIO was a bad idea, since that symbol is not user-selectable. So we should have kept a 'select REGMAP_MMIO'.
When we do that, we run into 2 more problems:
- By depending on GENERIC_PHY, we are causing a recursive dependency. But it looks like GENERIC_PHY has no other dependencies, and other drivers select it, so we can select it too:
drivers/of/Kconfig:69:error: recursive dependency detected! drivers/of/Kconfig:69: symbol OF_IRQ depends on IRQ_DOMAIN kernel/irq/Kconfig:68: symbol IRQ_DOMAIN is selected by REGMAP drivers/base/regmap/Kconfig:7: symbol REGMAP default is visible depending on REGMAP_MMIO drivers/base/regmap/Kconfig:39: symbol REGMAP_MMIO is selected by MSCC_OCELOT_SWITCH_LIBdrivers/net/ethernet/mscc/Kconfig:15: symbol MSCC_OCELOT_SWITCH_LIB is selected by MSCC_OCELOT_SWITCHdrivers/net/ethernet/mscc/Kconfig:22: symbol MSCC_OCELOT_SWITCH depends on GENERIC_PHYdrivers/phy/Kconfig:8: symbol GENERIC_PHY is selected by PHY_BCM_NS_USB3drivers/phy/broadcom/Kconfig:41: symbol PHY_BCM_NS_USB3 depends on MDIO_BUS
drivers/net/phy/Kconfig:13: symbol MDIO_BUS depends on MDIO_DEVICE drivers/net/phy/Kconfig:6: symbol MDIO_DEVICE is selected by PHYLIB drivers/net/phy/Kconfig:254: symbol PHYLIB is selected by ARC_EMAC_CORE
drivers/net/ethernet/arc/Kconfig:19: symbol ARC_EMAC_CORE is selected by ARC_EMACdrivers/net/ethernet/arc/Kconfig:25: symbol ARC_EMAC depends on OF_IRQ
- By depending on PHYLIB, we are causing a recursive dependency. PHYLIB only has a single dependency, "depends on NETDEVICES", which we are already depending on, so we can again hack our way into conformance by turning the PHYLIB dependency into a select.
drivers/of/Kconfig:69:error: recursive dependency detected! drivers/of/Kconfig:69: symbol OF_IRQ depends on IRQ_DOMAIN kernel/irq/Kconfig:68: symbol IRQ_DOMAIN is selected by REGMAP drivers/base/regmap/Kconfig:7: symbol REGMAP default is visible depending on REGMAP_MMIO drivers/base/regmap/Kconfig:39: symbol REGMAP_MMIO is selected by MSCC_OCELOT_SWITCH_LIBdrivers/net/ethernet/mscc/Kconfig:15: symbol MSCC_OCELOT_SWITCH_LIB is selected by MSCC_OCELOT_SWITCHdrivers/net/ethernet/mscc/Kconfig:22: symbol MSCC_OCELOT_SWITCH depends on PHYLIBdrivers/net/phy/Kconfig:254: symbol PHYLIB is selected by ARC_EMAC_COREdrivers/net/ethernet/arc/Kconfig:19: symbol ARC_EMAC_CORE is selected by ARC_EMACdrivers/net/ethernet/arc/Kconfig:25: symbol ARC_EMAC depends on OF_IRQ
--- drivers/net/dsa/ocelot/Kconfig | 1 - drivers/net/ethernet/mscc/Kconfig | 8 ++++---- 2 files changed, 4 insertions(+), 5 deletions(-)
drivers/net/dsa/ocelot/Kconfig +0 -1
@@ -5,7 +5,6 @@ config NET_DSA_MSCC_FELIX depends on NET_VENDOR_MICROSEMI depends on NET_VENDOR_FREESCALE depends on HAS_IOMEM - depends on REGMAP_MMIO select MSCC_OCELOT_SWITCH_LIB select NET_DSA_TAG_OCELOT select FSL_ENETC_MDIO
drivers/net/ethernet/mscc/Kconfig +4 -4
@@ -11,8 +11,10 @@ config NET_VENDOR_MICROSEMI if NET_VENDOR_MICROSEMI -# Users should depend on NET_SWITCHDEV, HAS_IOMEM, PHYLIB and REGMAP_MMIO +# Users should depend on NET_SWITCHDEV, HAS_IOMEM config MSCC_OCELOT_SWITCH_LIB + select REGMAP_MMIO + select PHYLIB tristate help This is a hardware support library for Ocelot network switches. It is
@@ -21,12 +23,10 @@ config MSCC_OCELOT_SWITCH_LIB config MSCC_OCELOT_SWITCH tristate "Ocelot switch driver" depends on NET_SWITCHDEV - depends on GENERIC_PHY - depends on REGMAP_MMIO depends on HAS_IOMEM - depends on PHYLIB depends on OF_NET select MSCC_OCELOT_SWITCH_LIB + select GENERIC_PHY help This driver supports the Ocelot network switch device as present on the Ocelot SoCs (VSC7514).
Signature · 1 line
2.25.1
Quoted 5 lines · On Mon, 13 Jul 2020 00:28:33 +0300 Vladimir Oltean wrote:
From: Vladimir Oltean <[email protected]>
Having the users of
MSCC_OCELOT_SWITCH_LIBdepend onREGMAP_MMIOwas a bad idea, since that symbol is not user-selectable. So we should have kept a 'selectREGMAP_MMIO'.
Applied, thanks.