Message ID | 20241216104826.6946-1-marex@denx.de |
---|---|
State | New |
Headers | show |
Series | [v2] leds: trigger: netdev: Check offload ability on interface up | expand |
On Mon, 16 Dec 2024 11:48:22 +0100, Marek Vasut wrote: > The trigger_data->hw_control indicates whether the LED is controlled by HW > offload, i.e. the PHY. The trigger_data->hw_control = can_hw_control() is > currently called only from netdev_led_attr_store(), i.e. when writing any > sysfs attribute of the netdev trigger instance associated with a PHY LED. > > The can_hw_control() calls validate_net_dev() which internally calls > led_cdev->hw_control_get_device(), which is phy_led_hw_control_get_device() > for PHY LEDs. The phy_led_hw_control_get_device() returns NULL if the PHY > is not attached. > > [...] Applied, thanks! [1/1] leds: trigger: netdev: Check offload ability on interface up commit: 0dfda50988c6805e8ab432e99866a021ea6ec46d -- Lee Jones [李琼斯]
diff --git a/drivers/leds/trigger/ledtrig-netdev.c b/drivers/leds/trigger/ledtrig-netdev.c index 4b0863db901a9..c15efe3e50780 100644 --- a/drivers/leds/trigger/ledtrig-netdev.c +++ b/drivers/leds/trigger/ledtrig-netdev.c @@ -605,6 +605,8 @@ static int netdev_trig_notify(struct notifier_block *nb, trigger_data->net_dev = NULL; break; case NETDEV_UP: + trigger_data->hw_control = can_hw_control(trigger_data); + fallthrough; case NETDEV_CHANGE: get_device_state(trigger_data); /* Refresh link_speed visibility */