]> git.neil.brown.name Git - history.git/commitdiff
sysfs: reinstate count parameter to sysfs_ops.store() methods.
authorPatrick Mochel <mochel@osdl.org>
Mon, 13 Jan 2003 04:48:02 +0000 (22:48 -0600)
committerPatrick Mochel <mochel@osdl.org>
Mon, 13 Jan 2003 04:48:02 +0000 (22:48 -0600)
- Fixup struct device_attribute.
- Fix the default device attributes.

drivers/base/core.c
drivers/base/interface.c
include/linux/device.h

index 8e66d54a1c27738377476ae6986121bafb8703d6..40fe758731baf176f535aa6aefe8cf99e01f16b5 100644 (file)
@@ -47,14 +47,15 @@ dev_attr_show(struct kobject * kobj, struct attribute * attr, char * buf)
 }
 
 static ssize_t
-dev_attr_store(struct kobject * kobj, struct attribute * attr, const char * buf)
+dev_attr_store(struct kobject * kobj, struct attribute * attr, 
+              const char * buf, size_t count)
 {
        struct device_attribute * dev_attr = to_dev_attr(attr);
        struct device * dev = to_dev(kobj);
        ssize_t ret = 0;
 
        if (dev_attr->store)
-               ret = dev_attr->store(dev,buf);
+               ret = dev_attr->store(dev,buf,count);
        return ret;
 }
 
index ebf359fbca74630273e95cad0afae6de14630fba..9b1c0f0f1cc559771def1b25062a5b2adc6b0331 100644 (file)
@@ -24,7 +24,7 @@ device_read_power(struct device * dev, char * page)
 }
 
 static ssize_t
-device_write_power(struct device * dev, const char * buf)
+device_write_power(struct device * dev, const char * buf, size_t count)
 {
        char    str_command[20];
        char    str_level[20];
@@ -80,7 +80,7 @@ device_write_power(struct device * dev, const char * buf)
                        error = 0;
        }
  done:
-       return error < 0 ? error : strlen(buf);
+       return error < 0 ? error : count;
 }
 
 static DEVICE_ATTR(power,S_IWUSR | S_IRUGO,
index 17536217d0c24c180085e77c57ea6cfb38d24dac..c2b01b98c46418dbaecfa34ea63825f1d1af38d5 100644 (file)
@@ -320,7 +320,7 @@ extern void device_release_driver(struct device * dev);
 struct device_attribute {
        struct attribute        attr;
        ssize_t (*show)(struct device * dev, char * buf);
-       ssize_t (*store)(struct device * dev, const char * buf);
+       ssize_t (*store)(struct device * dev, const char * buf, size_t count);
 };
 
 #define DEVICE_ATTR(_name,_mode,_show,_store) \