Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

net: phy: fix circular LEDS_CLASS dependencies

The CONFIG_PHYLIB symbol is selected by a number of device drivers that
need PHY support, but it now has a dependency on CONFIG_LEDS_CLASS,
which may not be enabled, causing build failures.

Avoid the risk of missing and circular dependencies by guarding the
phylib LED support itself in another Kconfig symbol that can only be
enabled if the dependency is met.

This could be made a hidden symbol and always enabled when both CONFIG_OF
and CONFIG_LEDS_CLASS are reachable from the phylib, but there may be an
advantage in having users see this option when they have a misconfigured
kernel without built-in LED support.

Fixes: 01e5b728e9e4 ("net: phy: Add a binding for PHY LEDs")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://lore.kernel.org/r/20230420084624.3005701-1-arnd@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Arnd Bergmann and committed by
Jakub Kicinski
4bb7aac7 681c5b51

+10 -2
+8 -1
drivers/net/phy/Kconfig
··· 18 18 depends on NETDEVICES 19 19 select MDIO_DEVICE 20 20 select MDIO_DEVRES 21 - depends on LEDS_CLASS || LEDS_CLASS=n 22 21 help 23 22 Ethernet controllers are usually attached to PHY 24 23 devices. This option provides infrastructure for ··· 44 45 <Speed in megabits>Mbps OR <Speed in gigabits>Gbps OR link 45 46 for any speed known to the PHY. 46 47 48 + config PHYLIB_LEDS 49 + bool "Support probing LEDs from device tree" 50 + depends on LEDS_CLASS=y || LEDS_CLASS=PHYLIB 51 + depends on OF 52 + default y 53 + help 54 + When LED class support is enabled, phylib can automatically 55 + probe LED setting from device tree. 47 56 48 57 config FIXED_PHY 49 58 tristate "MDIO Bus/PHY emulation with fixed speed/link PHYs"
+2 -1
drivers/net/phy/phy_device.c
··· 3284 3284 /* Get the LEDs from the device tree, and instantiate standard 3285 3285 * LEDs for them. 3286 3286 */ 3287 - err = of_phy_leds(phydev); 3287 + if (IS_ENABLED(CONFIG_PHYLIB_LEDS)) 3288 + err = of_phy_leds(phydev); 3288 3289 3289 3290 out: 3290 3291 /* Re-assert the reset signal on error */