swconfig: "swconfig list" shows devices in reverse order
authorJohn Crispin <john@openwrt.org>
Wed, 29 Oct 2014 18:51:06 +0000 (18:51 +0000)
committerJohn Crispin <john@openwrt.org>
Wed, 29 Oct 2014 18:51:06 +0000 (18:51 +0000)
Boards that have more than one swconfig enabled switch will show the devices in
reverse order when call swconfig list. Fix this by using list_add_tail().

Signed-off-by: John Crispin <blogic@openwrt.org>
SVN-Revision: 43106

target/linux/generic/files/drivers/net/phy/swconfig.c

index ba9136c34f4feb2eafbaa4e978a6699446ba8303..de1dde22cffe4eb2061b5117719931b976b12369 100644 (file)
@@ -1079,7 +1079,7 @@ register_switch(struct switch_dev *dev, struct net_device *netdev)
        /* fill device name */
        snprintf(dev->devname, IFNAMSIZ, SWCONFIG_DEVNAME, i);
 
-       list_add(&dev->dev_list, &swdevs);
+       list_add_last(&dev->dev_list, &swdevs);
        swconfig_unlock();
 
        err = swconfig_create_led_trigger(dev);