- Fixup struct device_attribute.
- Fix the default device attributes.
}
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;
}
}
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];
error = 0;
}
done:
- return error < 0 ? error : strlen(buf);
+ return error < 0 ? error : count;
}
static DEVICE_ATTR(power,S_IWUSR | S_IRUGO,
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) \