summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/base/core.c5
-rw-r--r--drivers/base/interface.c4
-rw-r--r--include/linux/device.h2
3 files changed, 6 insertions, 5 deletions
diff --git a/drivers/base/core.c b/drivers/base/core.c
index 8e66d54a1c27..40fe758731ba 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -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;
}
diff --git a/drivers/base/interface.c b/drivers/base/interface.c
index ebf359fbca74..9b1c0f0f1cc5 100644
--- a/drivers/base/interface.c
+++ b/drivers/base/interface.c
@@ -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,
diff --git a/include/linux/device.h b/include/linux/device.h
index 17536217d0c2..c2b01b98c464 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -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) \