Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 1126
b: refs/heads/master
c: baae956
h: refs/heads/master
v: v3
  • Loading branch information
Dmitry Torokhov authored and Linus Torvalds committed May 17, 2005
1 parent baa4653 commit 7dac709
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 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: 1ff2c873ca11f9e6abffb004b908756b27597672
refs/heads/master: baae956100334ffbd101eea5eeea9a5ac9cf3abd
24 changes: 20 additions & 4 deletions trunk/drivers/input/serio/serio.c
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,24 @@ static ssize_t serio_show_id_extra(struct device *dev, char *buf)
return sprintf(buf, "%02x\n", serio->id.extra);
}

static DEVICE_ATTR(type, S_IRUGO, serio_show_id_type, NULL);
static DEVICE_ATTR(proto, S_IRUGO, serio_show_id_proto, NULL);
static DEVICE_ATTR(id, S_IRUGO, serio_show_id_id, NULL);
static DEVICE_ATTR(extra, S_IRUGO, serio_show_id_extra, NULL);

static struct attribute *serio_device_id_attrs[] = {
&dev_attr_type.attr,
&dev_attr_proto.attr,
&dev_attr_id.attr,
&dev_attr_extra.attr,
NULL
};

static struct attribute_group serio_id_attr_group = {
.name = "id",
.attrs = serio_device_id_attrs,
};

static ssize_t serio_rebind_driver(struct device *dev, const char *buf, size_t count)
{
struct serio *serio = to_serio_port(dev);
Expand Down Expand Up @@ -444,10 +462,6 @@ static ssize_t serio_set_bind_mode(struct device *dev, const char *buf, size_t c

static struct device_attribute serio_device_attrs[] = {
__ATTR(description, S_IRUGO, serio_show_description, NULL),
__ATTR(id_type, S_IRUGO, serio_show_id_type, NULL),
__ATTR(id_proto, S_IRUGO, serio_show_id_proto, NULL),
__ATTR(id_id, S_IRUGO, serio_show_id_id, NULL),
__ATTR(id_extra, S_IRUGO, serio_show_id_extra, NULL),
__ATTR(drvctl, S_IWUSR, NULL, serio_rebind_driver),
__ATTR(bind_mode, S_IWUSR | S_IRUGO, serio_show_bind_mode, serio_set_bind_mode),
__ATTR_NULL
Expand Down Expand Up @@ -498,6 +512,7 @@ static void serio_add_port(struct serio *serio)
if (serio->start)
serio->start(serio);
device_add(&serio->dev);
sysfs_create_group(&serio->dev.kobj, &serio_id_attr_group);
serio->registered = 1;
}

Expand Down Expand Up @@ -526,6 +541,7 @@ static void serio_destroy_port(struct serio *serio)
}

if (serio->registered) {
sysfs_remove_group(&serio->dev.kobj, &serio_id_attr_group);
device_del(&serio->dev);
list_del_init(&serio->node);
serio->registered = 0;
Expand Down

0 comments on commit 7dac709

Please sign in to comment.