X-Git-Url: http://git.rohieb.name/openwrt.git/blobdiff_plain/47cebba347fe9e484656576a0df3459921d517d5..3651d1c3327053bb67b1442502345473a4152884:/target/linux/generic/files/drivers/net/phy/swconfig.c diff --git a/target/linux/generic/files/drivers/net/phy/swconfig.c b/target/linux/generic/files/drivers/net/phy/swconfig.c index 2038330ba..1f4491ac5 100644 --- a/target/linux/generic/files/drivers/net/phy/swconfig.c +++ b/target/linux/generic/files/drivers/net/phy/swconfig.c @@ -33,6 +33,8 @@ #define SWCONFIG_DEVNAME "switch%d" +#include "swconfig_leds.c" + MODULE_AUTHOR("Felix Fietkau "); MODULE_LICENSE("GPL"); @@ -863,6 +865,7 @@ register_switch(struct switch_dev *dev, struct net_device *netdev) struct switch_dev *sdev; const int max_switches = 8 * sizeof(unsigned long); unsigned long in_use = 0; + int err; int i; INIT_LIST_HEAD(&dev->dev_list); @@ -905,6 +908,10 @@ register_switch(struct switch_dev *dev, struct net_device *netdev) list_add(&dev->dev_list, &swdevs); swconfig_unlock(); + err = swconfig_create_led_trigger(dev); + if (err) + return err; + return 0; } EXPORT_SYMBOL_GPL(register_switch); @@ -912,6 +919,7 @@ EXPORT_SYMBOL_GPL(register_switch); void unregister_switch(struct switch_dev *dev) { + swconfig_destroy_led_trigger(dev); kfree(dev->portbuf); spin_lock(&dev->lock); swconfig_lock();