diff options
author | Andi Kleen <andi@firstfloor.org> | 2010-01-05 06:48:07 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-03-07 20:04:48 -0500 |
commit | 28812fe11a21826ba4c97c6c7971a619987cd912 (patch) | |
tree | c78daefd595989bbc660ea48d8bc2dc5750321d3 /drivers/net | |
parent | 5fbcae57db69128c14080a7a5a42d0626bfe155c (diff) |
driver-core: Add attribute argument to class_attribute show/store
Passing the attribute to the low level IO functions allows all kinds
of cleanups, by sharing low level IO code without requiring
an own function for every piece of data.
Also drivers can extend the attributes with own data fields
and use that in the low level function.
This makes the class attributes the same as sysdev_class attributes
and plain attributes.
This will allow further cleanups in drivers.
Full tree sweep converting all users.
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/bonding/bond_sysfs.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c index 5acd557cea9b..b8bec086daa1 100644 --- a/drivers/net/bonding/bond_sysfs.c +++ b/drivers/net/bonding/bond_sysfs.c | |||
@@ -51,7 +51,9 @@ | |||
51 | * "show" function for the bond_masters attribute. | 51 | * "show" function for the bond_masters attribute. |
52 | * The class parameter is ignored. | 52 | * The class parameter is ignored. |
53 | */ | 53 | */ |
54 | static ssize_t bonding_show_bonds(struct class *cls, char *buf) | 54 | static ssize_t bonding_show_bonds(struct class *cls, |
55 | struct class_attribute *attr, | ||
56 | char *buf) | ||
55 | { | 57 | { |
56 | struct net *net = current->nsproxy->net_ns; | 58 | struct net *net = current->nsproxy->net_ns; |
57 | struct bond_net *bn = net_generic(net, bond_net_id); | 59 | struct bond_net *bn = net_generic(net, bond_net_id); |
@@ -98,6 +100,7 @@ static struct net_device *bond_get_by_name(struct net *net, const char *ifname) | |||
98 | */ | 100 | */ |
99 | 101 | ||
100 | static ssize_t bonding_store_bonds(struct class *cls, | 102 | static ssize_t bonding_store_bonds(struct class *cls, |
103 | struct class_attribute *attr, | ||
101 | const char *buffer, size_t count) | 104 | const char *buffer, size_t count) |
102 | { | 105 | { |
103 | struct net *net = current->nsproxy->net_ns; | 106 | struct net *net = current->nsproxy->net_ns; |