net: dsa: rtl8366rb: Move LED blink init to LED code The code was setting up 56ms blink rate unconditionally, but now that we have separate LED support code, let's do it there while waiting for someone to come along and implement proper HW trigger handling for these LEDs. Reported-by: Vladimir Oltean <olteanv@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
diff --git a/drivers/net/dsa/realtek/rtl8366rb-leds.c b/drivers/net/dsa/realtek/rtl8366rb-leds.c index 72016d6..6ec4b1c 100644 --- a/drivers/net/dsa/realtek/rtl8366rb-leds.c +++ b/drivers/net/dsa/realtek/rtl8366rb-leds.c
@@ -152,6 +152,15 @@ int rtl8366rb_setup_leds(struct realtek_priv *priv) struct dsa_port *dp; int ret = 0; + /* Set blinking, used by all LED groups using HW triggers. + * TODO: make this configurable, implement proper HW triggers. + */ + ret = regmap_update_bits(priv->map, RTL8366RB_LED_BLINKRATE_REG, + RTL8366RB_LED_BLINKRATE_MASK, + RTL8366RB_LED_BLINKRATE_56MS); + if (ret) + return ret; + dsa_switch_for_each_port(dp, ds) { if (!dp->dn) continue;
diff --git a/drivers/net/dsa/realtek/rtl8366rb.c b/drivers/net/dsa/realtek/rtl8366rb.c index d96ae72..671e59e 100644 --- a/drivers/net/dsa/realtek/rtl8366rb.c +++ b/drivers/net/dsa/realtek/rtl8366rb.c
@@ -979,15 +979,6 @@ static int rtl8366rb_setup(struct dsa_switch *ds) if (ret) return ret; - /* Set blinking, used by all LED groups using HW triggers. - * TODO: make this configurable - */ - ret = regmap_update_bits(priv->map, RTL8366RB_LED_BLINKRATE_REG, - RTL8366RB_LED_BLINKRATE_MASK, - RTL8366RB_LED_BLINKRATE_56MS); - if (ret) - return ret; - /* Set up LED activity: * Each port has 4 LEDs on fixed groups. Each group shares the same * hardware trigger across all ports. LEDs can only be indiviually