diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2006-10-17 08:56:43 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-10-17 08:56:43 -0700 |
commit | 43f82216f0bd114599f4a221ae6924f3658a0c9a (patch) | |
tree | 89dbd85a0a1882ae38e6b61e360b365c018195fd /drivers/input/serio/serio.c | |
parent | 20f85957667ccc53183b5ffac22213d75e317408 (diff) | |
parent | b435fdcda126db42343b8055d04a0a27c229717b (diff) | |
download | linux-43f82216f0bd114599f4a221ae6924f3658a0c9a.tar.bz2 |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
* git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
Input: fm801-gp - handle errors from pci_enable_device()
Input: gameport core - handle errors returned by device_bind_driver()
Input: serio core - handle errors returned by device_bind_driver()
Lockdep: fix compile error in drivers/input/serio/serio.c
Input: serio - add lockdep annotations
Lockdep: add lockdep_set_class_and_subclass() and lockdep_set_subclass()
Input: atkbd - supress "too many keys" error message
Input: i8042 - supress ACK/NAKs when blinking during panic
Input: add missing exports to fix modular build
Diffstat (limited to 'drivers/input/serio/serio.c')
-rw-r--r-- | drivers/input/serio/serio.c | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/drivers/input/serio/serio.c b/drivers/input/serio/serio.c index 960fae3c3cea..211943f85cb6 100644 --- a/drivers/input/serio/serio.c +++ b/drivers/input/serio/serio.c @@ -118,6 +118,8 @@ static int serio_match_port(const struct serio_device_id *ids, struct serio *ser static void serio_bind_driver(struct serio *serio, struct serio_driver *drv) { + int error; + down_write(&serio_bus.subsys.rwsem); if (serio_match_port(drv->id_table, serio)) { @@ -126,9 +128,19 @@ static void serio_bind_driver(struct serio *serio, struct serio_driver *drv) serio->dev.driver = NULL; goto out; } - device_bind_driver(&serio->dev); + error = device_bind_driver(&serio->dev); + if (error) { + printk(KERN_WARNING + "serio: device_bind_driver() failed " + "for %s (%s) and %s, error: %d\n", + serio->phys, serio->name, + drv->description, error); + serio_disconnect_driver(serio); + serio->dev.driver = NULL; + goto out; + } } -out: + out: up_write(&serio_bus.subsys.rwsem); } @@ -538,8 +550,12 @@ static void serio_init_port(struct serio *serio) "serio%ld", (long)atomic_inc_return(&serio_no) - 1); serio->dev.bus = &serio_bus; serio->dev.release = serio_release_port; - if (serio->parent) + if (serio->parent) { serio->dev.parent = &serio->parent->dev; + serio->depth = serio->parent->depth + 1; + } else + serio->depth = 0; + lockdep_set_subclass(&serio->lock, serio->depth); } /* |