diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-09-03 11:37:15 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-09-03 11:37:15 -0700 |
commit | 542a086ac72fb193cbc1b996963a572269e57743 (patch) | |
tree | b137c08037cca4ffc8a156a891a01113b3b8edce /drivers/staging | |
parent | 1d1fdd95df681f0c065d90ffaafa215a0e8825e2 (diff) | |
parent | 1eeeef153c02f5856ec109fa532eb5f31c39f85c (diff) |
Merge tag 'driver-core-3.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core
Pull driver core patches from Greg KH:
"Here's the big driver core pull request for 3.12-rc1.
Lots of tiny changes here fixing up the way sysfs attributes are
created, to try to make drivers simpler, and fix a whole class race
conditions with creations of device attributes after the device was
announced to userspace.
All the various pieces are acked by the different subsystem
maintainers"
* tag 'driver-core-3.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (119 commits)
firmware loader: fix pending_fw_head list corruption
drivers/base/memory.c: introduce help macro to_memory_block
dynamic debug: line queries failing due to uninitialized local variable
sysfs: sysfs_create_groups returns a value.
debugfs: provide debugfs_create_x64() when disabled
rbd: convert bus code to use bus_groups
firmware: dcdbas: use binary attribute groups
sysfs: add sysfs_create/remove_groups for when SYSFS is not enabled
driver core: add #include <linux/sysfs.h> to core files.
HID: convert bus code to use dev_groups
Input: serio: convert bus code to use drv_groups
Input: gameport: convert bus code to use drv_groups
driver core: firmware: use __ATTR_RW()
driver core: core: use DEVICE_ATTR_RO
driver core: bus: use DRIVER_ATTR_WO()
driver core: create write-only attribute macros for devices and drivers
sysfs: create __ATTR_WO()
driver-core: platform: convert bus code to use dev_groups
workqueue: convert bus code to use dev_groups
MEI: convert bus code to use dev_groups
...
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/comedi/comedi_fops.c | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c index f4a197b2d1fd..6d50e3033228 100644 --- a/drivers/staging/comedi/comedi_fops.c +++ b/drivers/staging/comedi/comedi_fops.c @@ -262,7 +262,7 @@ static int resize_async_buffer(struct comedi_device *dev, /* sysfs attribute files */ -static ssize_t show_max_read_buffer_kb(struct device *csdev, +static ssize_t max_read_buffer_kb_show(struct device *csdev, struct device_attribute *attr, char *buf) { unsigned int minor = MINOR(csdev->devt); @@ -283,7 +283,7 @@ static ssize_t show_max_read_buffer_kb(struct device *csdev, return snprintf(buf, PAGE_SIZE, "%i\n", size); } -static ssize_t store_max_read_buffer_kb(struct device *csdev, +static ssize_t max_read_buffer_kb_store(struct device *csdev, struct device_attribute *attr, const char *buf, size_t count) { @@ -314,8 +314,9 @@ static ssize_t store_max_read_buffer_kb(struct device *csdev, return err ? err : count; } +static DEVICE_ATTR_RW(max_read_buffer_kb); -static ssize_t show_read_buffer_kb(struct device *csdev, +static ssize_t read_buffer_kb_show(struct device *csdev, struct device_attribute *attr, char *buf) { unsigned int minor = MINOR(csdev->devt); @@ -336,7 +337,7 @@ static ssize_t show_read_buffer_kb(struct device *csdev, return snprintf(buf, PAGE_SIZE, "%i\n", size); } -static ssize_t store_read_buffer_kb(struct device *csdev, +static ssize_t read_buffer_kb_store(struct device *csdev, struct device_attribute *attr, const char *buf, size_t count) { @@ -367,8 +368,9 @@ static ssize_t store_read_buffer_kb(struct device *csdev, return err ? err : count; } +static DEVICE_ATTR_RW(read_buffer_kb); -static ssize_t show_max_write_buffer_kb(struct device *csdev, +static ssize_t max_write_buffer_kb_show(struct device *csdev, struct device_attribute *attr, char *buf) { @@ -390,7 +392,7 @@ static ssize_t show_max_write_buffer_kb(struct device *csdev, return snprintf(buf, PAGE_SIZE, "%i\n", size); } -static ssize_t store_max_write_buffer_kb(struct device *csdev, +static ssize_t max_write_buffer_kb_store(struct device *csdev, struct device_attribute *attr, const char *buf, size_t count) { @@ -421,8 +423,9 @@ static ssize_t store_max_write_buffer_kb(struct device *csdev, return err ? err : count; } +static DEVICE_ATTR_RW(max_write_buffer_kb); -static ssize_t show_write_buffer_kb(struct device *csdev, +static ssize_t write_buffer_kb_show(struct device *csdev, struct device_attribute *attr, char *buf) { unsigned int minor = MINOR(csdev->devt); @@ -443,7 +446,7 @@ static ssize_t show_write_buffer_kb(struct device *csdev, return snprintf(buf, PAGE_SIZE, "%i\n", size); } -static ssize_t store_write_buffer_kb(struct device *csdev, +static ssize_t write_buffer_kb_store(struct device *csdev, struct device_attribute *attr, const char *buf, size_t count) { @@ -474,18 +477,16 @@ static ssize_t store_write_buffer_kb(struct device *csdev, return err ? err : count; } +static DEVICE_ATTR_RW(write_buffer_kb); -static struct device_attribute comedi_dev_attrs[] = { - __ATTR(max_read_buffer_kb, S_IRUGO | S_IWUSR, - show_max_read_buffer_kb, store_max_read_buffer_kb), - __ATTR(read_buffer_kb, S_IRUGO | S_IWUSR | S_IWGRP, - show_read_buffer_kb, store_read_buffer_kb), - __ATTR(max_write_buffer_kb, S_IRUGO | S_IWUSR, - show_max_write_buffer_kb, store_max_write_buffer_kb), - __ATTR(write_buffer_kb, S_IRUGO | S_IWUSR | S_IWGRP, - show_write_buffer_kb, store_write_buffer_kb), - __ATTR_NULL +static struct attribute *comedi_dev_attrs[] = { + &dev_attr_max_read_buffer_kb.attr, + &dev_attr_read_buffer_kb.attr, + &dev_attr_max_write_buffer_kb.attr, + &dev_attr_write_buffer_kb.attr, + NULL, }; +ATTRIBUTE_GROUPS(comedi_dev); static void comedi_set_subdevice_runflags(struct comedi_subdevice *s, unsigned mask, unsigned bits) @@ -2564,7 +2565,7 @@ static int __init comedi_init(void) return PTR_ERR(comedi_class); } - comedi_class->dev_attrs = comedi_dev_attrs; + comedi_class->dev_groups = comedi_dev_groups; /* XXX requires /proc interface */ comedi_proc_init(); |