@@ -465,6 +465,13 @@ static int netdev_trig_activate(struct led_classdev *led_cdev)
atomic_set(&trigger_data->interval, msecs_to_jiffies(50));
trigger_data->last_activity = 0;
+ /* Check if hw control is active by default on the LED.
+ * Init already enabled mode in hw control.
+ */
+ if (led_trigger_can_hw_control(led_cdev) &&
+ !led_cdev->hw_control_get(led_cdev, &trigger_data->mode))
+ trigger_data->hw_control = true;
+
led_set_trigger_data(led_cdev, trigger_data);
rc = register_netdevice_notifier(&trigger_data->notifier);
On netdev trigger activation, hw control may be already active by default. If this is the case, init the already active mode and set the bool to hw_control bool to true to reflect the already set mode in the trigger_data. Signed-off-by: Christian Marangi <ansuelsmth@gmail.com> --- drivers/leds/trigger/ledtrig-netdev.c | 7 +++++++ 1 file changed, 7 insertions(+)