]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/net/bonding/bond_sysfs.c
jmr3927: do not call tc35815_killall().
[linux-2.6-omap-h63xx.git] / drivers / net / bonding / bond_sysfs.c
index 0e610aa1fdf916937a7955fb0c141514bd088f5f..a122baa5c7bb937ebcc5c436d5710fe785ae3b61 100644 (file)
@@ -22,7 +22,6 @@
  */
 #include <linux/kernel.h>
 #include <linux/module.h>
-#include <linux/sched.h>
 #include <linux/device.h>
 #include <linux/sysdev.h>
 #include <linux/fs.h>
@@ -1433,6 +1432,21 @@ int bond_create_sysfs(void)
                return -ENODEV;
 
        ret = class_create_file(netdev_class, &class_attr_bonding_masters);
+       /*
+        * Permit multiple loads of the module by ignoring failures to
+        * create the bonding_masters sysfs file.  Bonding devices
+        * created by second or subsequent loads of the module will
+        * not be listed in, or controllable by, bonding_masters, but
+        * will have the usual "bonding" sysfs directory.
+        *
+        * This is done to preserve backwards compatibility for
+        * initscripts/sysconfig, which load bonding multiple times to
+        * configure multiple bonding devices.
+        */
+       if (ret == -EEXIST) {
+               netdev_class = NULL;
+               return 0;
+       }
 
        return ret;