[PATCH] net: dsa: motorcomm: fix unused-function warning

From: Arnd Bergmann

Date: Wed Sep 16 2026 - 04:45:01 EST


From: Arnd Bergmann <arnd@xxxxxxxx>

gcc warns about an unused function here because the __maybe_unused
attribute is in the wrong part of the prototype:

drivers/net/dsa/motorcomm/leds.c:352:1: error: 'yt921x_cled_hw_control_get_device' defined but not used [-Werror=unused-function]
352 | yt921x_cled_hw_control_get_device(struct led_classdev *led_cdev)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Move the __maybe_unused attribute to refer to the function rather
than the returned object.

Fixes: 9af9a8168213 ("net: dsa: motorcomm: Add LED support")
Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx>
---
drivers/net/dsa/motorcomm/leds.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/dsa/motorcomm/leds.c b/drivers/net/dsa/motorcomm/leds.c
index 87a6b9cf6068..0e8761f37995 100644
--- a/drivers/net/dsa/motorcomm/leds.c
+++ b/drivers/net/dsa/motorcomm/leds.c
@@ -348,7 +348,7 @@ yt921x_cled_blink_set(struct led_classdev *led_cdev, unsigned long *delay_on,
return res;
}

-static struct device * __maybe_unused
+static struct device __maybe_unused *
yt921x_cled_hw_control_get_device(struct led_classdev *led_cdev)
{
struct yt921x_led *led = to_yt921x_led(led_cdev);
--
2.53.0