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>
This commit is contained in:
@@ -51,7 +51,9 @@
|
||||
* "show" function for the bond_masters attribute.
|
||||
* The class parameter is ignored.
|
||||
*/
|
||||
static ssize_t bonding_show_bonds(struct class *cls, char *buf)
|
||||
static ssize_t bonding_show_bonds(struct class *cls,
|
||||
struct class_attribute *attr,
|
||||
char *buf)
|
||||
{
|
||||
struct net *net = current->nsproxy->net_ns;
|
||||
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)
|
||||
*/
|
||||
|
||||
static ssize_t bonding_store_bonds(struct class *cls,
|
||||
struct class_attribute *attr,
|
||||
const char *buffer, size_t count)
|
||||
{
|
||||
struct net *net = current->nsproxy->net_ns;
|
||||
|
Reference in New Issue
Block a user