Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 304647
b: refs/heads/master
c: fb60367
h: refs/heads/master
i:
  304645: cc1ff8c
  304643: 6465aab
  304639: f9ef611
v: v3
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed May 14, 2012
1 parent 8ed120a commit e5f81b2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 41 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d3b487695120b5342067244253697eabb121436d
refs/heads/master: fb60367d5dff0e2ee3032f7daf212e5ed9863552
52 changes: 12 additions & 40 deletions trunk/drivers/staging/comedi/comedi_fops.c
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,6 @@ static ssize_t store_max_read_buffer_kb(struct device *dev,
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)
{
Expand Down Expand Up @@ -287,9 +284,6 @@ static ssize_t store_read_buffer_kb(struct device *dev,
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)
Expand Down Expand Up @@ -344,9 +338,6 @@ static ssize_t store_max_write_buffer_kb(struct device *dev,
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)
{
Expand Down Expand Up @@ -404,19 +395,16 @@ static ssize_t store_write_buffer_kb(struct device *dev,
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,
Expand Down Expand Up @@ -2355,6 +2343,8 @@ static int __init comedi_init(void)
return PTR_ERR(comedi_class);
}

comedi_class->dev_attrs = comedi_dev_attrs;

/* XXX requires /proc interface */
comedi_proc_init();

Expand Down Expand Up @@ -2496,7 +2486,6 @@ int comedi_alloc_board_minor(struct device *hardware_device)
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)
Expand Down Expand Up @@ -2532,14 +2521,6 @@ int comedi_alloc_board_minor(struct device *hardware_device)
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;
}

Expand Down Expand Up @@ -2590,7 +2571,6 @@ int comedi_alloc_subdevice_minor(struct comedi_device *dev,
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)
Expand Down Expand Up @@ -2621,14 +2601,6 @@ int comedi_alloc_subdevice_minor(struct comedi_device *dev,
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;
}

Expand Down

0 comments on commit e5f81b2

Please sign in to comment.