All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] net: phy: drop PHYLIB_LEDS knob
@ 2023-04-25 21:19 Paolo Abeni
  2023-04-25 21:35 ` Arnd Bergmann
  2023-04-25 21:38 ` Andrew Lunn
  0 siblings, 2 replies; 8+ messages in thread
From: Paolo Abeni @ 2023-04-25 21:19 UTC (permalink / raw)
  To: netdev
  Cc: Andrew Lunn, Heiner Kallweit, Russell King, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Arnd Bergmann

commit 4bb7aac70b5d ("net: phy: fix circular LEDS_CLASS dependencies")
solved a build failure, but introduces a new config knob with a default
'y' value: PHYLIB_LEDS.

The latter is against the current new config policy. The exception
was raised to allow the user to catch bad configurations without led
support.

Anyway the current definition of PHYLIB_LEDS does not fit the above
goal: if LEDS_CLASS is disabled, the new config will be available
only with PHYLIB disabled, too.

Instead of building a more complex and error-prone dependency definition
it looks simpler and more in line with the mentioned policies use
IS_REACHABLE(CONFIG_LEDS_CLASS) instead of the new symbol.

Suggested-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
---
@Andrew, @Arnd: the rationale here is to avoid the new config knob=y,
which caused in the past a few complains from Linus. In this case I
think the raised exception is not valid, for the reason mentioned above.

If you have different preferences or better solutions to address that,
please voice them :)
---
 drivers/net/phy/Kconfig      | 9 ---------
 drivers/net/phy/phy_device.c | 2 +-
 2 files changed, 1 insertion(+), 10 deletions(-)

diff --git a/drivers/net/phy/Kconfig b/drivers/net/phy/Kconfig
index 2f3ddc446cbb..f83420b86794 100644
--- a/drivers/net/phy/Kconfig
+++ b/drivers/net/phy/Kconfig
@@ -44,15 +44,6 @@ config LED_TRIGGER_PHY
 		<Speed in megabits>Mbps OR <Speed in gigabits>Gbps OR link
 		for any speed known to the PHY.
 
-config PHYLIB_LEDS
-	bool "Support probing LEDs from device tree"
-	depends on LEDS_CLASS=y || LEDS_CLASS=PHYLIB
-	depends on OF
-	default y
-	help
-	  When LED class support is enabled, phylib can automatically
-	  probe LED setting from device tree.
-
 config FIXED_PHY
 	tristate "MDIO Bus/PHY emulation with fixed speed/link PHYs"
 	select SWPHY
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index 17d0d0555a79..fd28d389b00f 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -3288,7 +3288,7 @@ static int phy_probe(struct device *dev)
 	/* Get the LEDs from the device tree, and instantiate standard
 	 * LEDs for them.
 	 */
-	if (IS_ENABLED(CONFIG_PHYLIB_LEDS))
+	if (IS_REACHABLE(CONFIG_LEDS_CLASS))
 		err = of_phy_leds(phydev);
 
 out:
-- 
2.40.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-04-26  7:56 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-25 21:19 [PATCH net-next] net: phy: drop PHYLIB_LEDS knob Paolo Abeni
2023-04-25 21:35 ` Arnd Bergmann
2023-04-25 21:57   ` Jakub Kicinski
2023-04-25 21:38 ` Andrew Lunn
2023-04-25 21:44   ` Arnd Bergmann
2023-04-25 22:01     ` Jakub Kicinski
2023-04-25 22:45       ` Andrew Lunn
2023-04-26  7:55   ` Paolo Abeni

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.