return count;
}
-static DEVICE_ATTR(max_read_buffer_kb, S_IRUGO | S_IWUSR,
- show_max_read_buffer_kb, store_max_read_buffer_kb);
-
static ssize_t show_read_buffer_kb(struct device *dev,
struct device_attribute *attr, char *buf)
{
return count;
}
-static DEVICE_ATTR(read_buffer_kb, S_IRUGO | S_IWUSR | S_IWGRP,
- show_read_buffer_kb, store_read_buffer_kb);
-
static ssize_t show_max_write_buffer_kb(struct device *dev,
struct device_attribute *attr,
char *buf)
return count;
}
-static DEVICE_ATTR(max_write_buffer_kb, S_IRUGO | S_IWUSR,
- show_max_write_buffer_kb, store_max_write_buffer_kb);
-
static ssize_t show_write_buffer_kb(struct device *dev,
struct device_attribute *attr, char *buf)
{
return count;
}
-static DEVICE_ATTR(write_buffer_kb, S_IRUGO | S_IWUSR | S_IWGRP,
- show_write_buffer_kb, store_write_buffer_kb);
-
-static struct attribute *comedi_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
-};
-
-static const struct attribute_group comedi_sysfs_files = {
- .attrs = comedi_attrs,
+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 long comedi_unlocked_ioctl(struct file *file, unsigned int cmd,
return PTR_ERR(comedi_class);
}
+ comedi_class->dev_attrs = comedi_dev_attrs;
+
/* XXX requires /proc interface */
comedi_proc_init();
struct comedi_device_file_info *info;
struct device *csdev;
unsigned i;
- int retval;
info = kzalloc(sizeof(struct comedi_device_file_info), GFP_KERNEL);
if (info == NULL)
info->device->class_dev = csdev;
dev_set_drvdata(csdev, info);
- retval = sysfs_create_group(&csdev->kobj, &comedi_sysfs_files);
- if (retval) {
- printk(KERN_ERR
- "comedi: failed to create sysfs attribute files\n");
- comedi_free_board_minor(i);
- return retval;
- }
-
return i;
}
struct comedi_device_file_info *info;
struct device *csdev;
unsigned i;
- int retval;
info = kmalloc(sizeof(struct comedi_device_file_info), GFP_KERNEL);
if (info == NULL)
s->class_dev = csdev;
dev_set_drvdata(csdev, info);
- retval = sysfs_create_group(&csdev->kobj, &comedi_sysfs_files);
- if (retval) {
- printk(KERN_ERR
- "comedi: failed to create sysfs attribute files\n");
- comedi_free_subdevice_minor(s);
- return retval;
- }
-
return i;
}