aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/serio
diff options
context:
space:
mode:
authorDmitry Torokhov <dtor@insightbb.com>2006-10-12 01:06:23 -0400
committerDmitry Torokhov <dtor@insightbb.com>2006-10-12 01:06:23 -0400
commit0a66045bcfd3a7ba5d1253f9f305b78bf636ac57 (patch)
tree3627a7bd879e2c2c4ad03c3899b15129d2900599 /drivers/input/serio
parent07646e217f473a3e6213f8228336a9046833d6aa (diff)
Input: serio core - handle errors returned by device_bind_driver()
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/serio')
-rw-r--r--drivers/input/serio/serio.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/drivers/input/serio/serio.c b/drivers/input/serio/serio.c
index 480fdc5d20b3..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
118 118
119static void serio_bind_driver(struct serio *serio, struct serio_driver *drv) 119static void serio_bind_driver(struct serio *serio, struct serio_driver *drv)
120{ 120{
121 int error;
122
121 down_write(&serio_bus.subsys.rwsem); 123 down_write(&serio_bus.subsys.rwsem);
122 124
123 if (serio_match_port(drv->id_table, serio)) { 125 if (serio_match_port(drv->id_table, serio)) {
@@ -126,9 +128,19 @@ static void serio_bind_driver(struct serio *serio, struct serio_driver *drv)
126 serio->dev.driver = NULL; 128 serio->dev.driver = NULL;
127 goto out; 129 goto out;
128 } 130 }
129 device_bind_driver(&serio->dev); 131 error = device_bind_driver(&serio->dev);
132 if (error) {
133 printk(KERN_WARNING
134 "serio: device_bind_driver() failed "
135 "for %s (%s) and %s, error: %d\n",
136 serio->phys, serio->name,
137 drv->description, error);
138 serio_disconnect_driver(serio);
139 serio->dev.driver = NULL;
140 goto out;
141 }
130 } 142 }
131out: 143 out:
132 up_write(&serio_bus.subsys.rwsem); 144 up_write(&serio_bus.subsys.rwsem);
133} 145}
134 146