leds: trigger: netdev: init mode if hw control already active
authorChristian Marangi <ansuelsmth@gmail.com>
Mon, 29 May 2023 16:32:40 +0000 (18:32 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 31 May 2023 08:42:09 +0000 (09:42 +0100)
commit0316cc5629d15880dd3f097d221c55ca648bcd61
tree611fad046fcb7b43d5dbaec106bd478a98e01600
parent33ec0b53befff2c0a7f3aa19ff08556d60585d6b
leds: trigger: netdev: init mode if hw control already active

On netdev trigger activation, hw control may be already active by
default. If this is the case and a device is actually provided by
hw_control_get_device(), 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.

Co-developed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/leds/trigger/ledtrig-netdev.c