|
@@ -53,7 +53,6 @@ extern struct bond_parm_tbl arp_validate_tbl[];
|
|
extern struct bond_parm_tbl fail_over_mac_tbl[];
|
|
extern struct bond_parm_tbl fail_over_mac_tbl[];
|
|
|
|
|
|
static int expected_refcount = -1;
|
|
static int expected_refcount = -1;
|
|
-static struct class *netdev_class;
|
|
|
|
/*--------------------------- Data Structures -----------------------------*/
|
|
/*--------------------------- Data Structures -----------------------------*/
|
|
|
|
|
|
/* Bonding sysfs lock. Why can't we just use the subsystem lock?
|
|
/* Bonding sysfs lock. Why can't we just use the subsystem lock?
|
|
@@ -1447,19 +1446,9 @@ static struct attribute_group bonding_group = {
|
|
*/
|
|
*/
|
|
int bond_create_sysfs(void)
|
|
int bond_create_sysfs(void)
|
|
{
|
|
{
|
|
- int ret = 0;
|
|
|
|
- struct bonding *firstbond;
|
|
|
|
-
|
|
|
|
- /* get the netdev class pointer */
|
|
|
|
- firstbond = container_of(bond_dev_list.next, struct bonding, bond_list);
|
|
|
|
- if (!firstbond)
|
|
|
|
- return -ENODEV;
|
|
|
|
-
|
|
|
|
- netdev_class = firstbond->dev->dev.class;
|
|
|
|
- if (!netdev_class)
|
|
|
|
- return -ENODEV;
|
|
|
|
|
|
+ int ret;
|
|
|
|
|
|
- ret = class_create_file(netdev_class, &class_attr_bonding_masters);
|
|
|
|
|
|
+ ret = netdev_class_create_file(&class_attr_bonding_masters);
|
|
/*
|
|
/*
|
|
* Permit multiple loads of the module by ignoring failures to
|
|
* Permit multiple loads of the module by ignoring failures to
|
|
* create the bonding_masters sysfs file. Bonding devices
|
|
* create the bonding_masters sysfs file. Bonding devices
|
|
@@ -1478,10 +1467,6 @@ int bond_create_sysfs(void)
|
|
printk(KERN_ERR
|
|
printk(KERN_ERR
|
|
"network device named %s already exists in sysfs",
|
|
"network device named %s already exists in sysfs",
|
|
class_attr_bonding_masters.attr.name);
|
|
class_attr_bonding_masters.attr.name);
|
|
- else {
|
|
|
|
- netdev_class = NULL;
|
|
|
|
- return 0;
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
|
|
|
|
return ret;
|
|
return ret;
|
|
@@ -1493,8 +1478,7 @@ int bond_create_sysfs(void)
|
|
*/
|
|
*/
|
|
void bond_destroy_sysfs(void)
|
|
void bond_destroy_sysfs(void)
|
|
{
|
|
{
|
|
- if (netdev_class)
|
|
|
|
- class_remove_file(netdev_class, &class_attr_bonding_masters);
|
|
|
|
|
|
+ netdev_class_remove_file(&class_attr_bonding_masters);
|
|
}
|
|
}
|
|
|
|
|
|
/*
|
|
/*
|