Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 183084
b: refs/heads/master
c: 386d877
h: refs/heads/master
v: v3
  • Loading branch information
Dmitry Torokhov committed Jan 6, 2010
1 parent 3bc1a5b commit 27605fb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 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: b45d44e7e00c1726dac9437b66c05d3d27acb3f0
refs/heads/master: 386d8772980be01b94bd463ea1e745732d7eb502
17 changes: 9 additions & 8 deletions trunk/drivers/input/serio/serio.c
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,11 @@ static struct attribute_group serio_id_attr_group = {
.attrs = serio_device_id_attrs,
};

static const struct attribute_group *serio_device_attr_groups[] = {
&serio_id_attr_group,
NULL
};

static ssize_t serio_rebind_driver(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
{
struct serio *serio = to_serio_port(dev);
Expand Down Expand Up @@ -539,6 +544,7 @@ static void serio_init_port(struct serio *serio)
(long)atomic_inc_return(&serio_no) - 1);
serio->dev.bus = &serio_bus;
serio->dev.release = serio_release_port;
serio->dev.groups = serio_device_attr_groups;
if (serio->parent) {
serio->dev.parent = &serio->parent->dev;
serio->depth = serio->parent->depth + 1;
Expand All @@ -562,21 +568,17 @@ static void serio_add_port(struct serio *serio)
}

list_add_tail(&serio->node, &serio_list);

if (serio->start)
serio->start(serio);

error = device_add(&serio->dev);
if (error)
printk(KERN_ERR
"serio: device_add() failed for %s (%s), error: %d\n",
serio->phys, serio->name, error);
else {
else
serio->registered = true;
error = sysfs_create_group(&serio->dev.kobj, &serio_id_attr_group);
if (error)
printk(KERN_ERR
"serio: sysfs_create_group() failed for %s (%s), error: %d\n",
serio->phys, serio->name, error);
}
}

/*
Expand Down Expand Up @@ -604,7 +606,6 @@ 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);
serio->registered = false;
}
Expand Down

0 comments on commit 27605fb

Please sign in to comment.