Commit 54b6f35c authored by Yani Ioannou's avatar Yani Ioannou Committed by Greg Kroah-Hartman

[PATCH] Driver core: change device_attribute callbacks

This patch adds the device_attribute paramerter to the
device_attribute store and show sysfs callback functions, and passes a
reference to the attribute when the callbacks are called.
Signed-off-by: default avatarYani Ioannou <yani.ioannou@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent ca2b94ba
...@@ -39,7 +39,7 @@ dev_attr_show(struct kobject * kobj, struct attribute * attr, char * buf) ...@@ -39,7 +39,7 @@ dev_attr_show(struct kobject * kobj, struct attribute * attr, char * buf)
ssize_t ret = -EIO; ssize_t ret = -EIO;
if (dev_attr->show) if (dev_attr->show)
ret = dev_attr->show(dev, buf); ret = dev_attr->show(dev, dev_attr, buf);
return ret; return ret;
} }
...@@ -52,7 +52,7 @@ dev_attr_store(struct kobject * kobj, struct attribute * attr, ...@@ -52,7 +52,7 @@ dev_attr_store(struct kobject * kobj, struct attribute * attr,
ssize_t ret = -EIO; ssize_t ret = -EIO;
if (dev_attr->store) if (dev_attr->store)
ret = dev_attr->store(dev, buf, count); ret = dev_attr->store(dev, dev_attr, buf, count);
return ret; return ret;
} }
......
...@@ -335,8 +335,10 @@ extern void driver_attach(struct device_driver * drv); ...@@ -335,8 +335,10 @@ extern void driver_attach(struct device_driver * drv);
struct device_attribute { struct device_attribute {
struct attribute attr; struct attribute attr;
ssize_t (*show)(struct device * dev, char * buf); ssize_t (*show)(struct device *dev, struct device_attribute *attr,
ssize_t (*store)(struct device * dev, const char * buf, size_t count); char *buf);
ssize_t (*store)(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count);
}; };
#define DEVICE_ATTR(_name,_mode,_show,_store) \ #define DEVICE_ATTR(_name,_mode,_show,_store) \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment