Messages in this thread Patch in this message | | | Subject | [PATCH] Driver core: change device_attribute callbacks | Date | Mon, 20 Jun 2005 15:59:28 -0700 | From | Greg KH <> |
| |
[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: Yani Ioannou <yani.ioannou@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
--- commit 54b6f35c99974e99e64c05c2895718355123c55f tree 321d08c397bc26b49c706ca5b86de7003c2329c0 parent ca2b94ba12f3c36fd3d6ed9d38b3798d4dad0d8b author Yani Ioannou <yani.ioannou@gmail.com> Tue, 17 May 2005 06:39:34 -0400 committer Greg Kroah-Hartman <gregkh@suse.de> Mon, 20 Jun 2005 15:15:31 -0700
drivers/base/core.c | 4 ++-- include/linux/device.h | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/base/core.c b/drivers/base/core.c --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -39,7 +39,7 @@ dev_attr_show(struct kobject * kobj, str ssize_t ret = -EIO; if (dev_attr->show) - ret = dev_attr->show(dev, buf); + ret = dev_attr->show(dev, dev_attr, buf); return ret; } @@ -52,7 +52,7 @@ dev_attr_store(struct kobject * kobj, st ssize_t ret = -EIO; if (dev_attr->store) - ret = dev_attr->store(dev, buf, count); + ret = dev_attr->store(dev, dev_attr, buf, count); return ret; } diff --git a/include/linux/device.h b/include/linux/device.h --- a/include/linux/device.h +++ b/include/linux/device.h @@ -335,8 +335,10 @@ extern void driver_attach(struct device_ struct device_attribute { struct attribute attr; - ssize_t (*show)(struct device * dev, char * buf); - ssize_t (*store)(struct device * dev, const char * buf, size_t count); + ssize_t (*show)(struct device *dev, struct device_attribute *attr, + 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) \ - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |