diff options
Diffstat (limited to 'drivers/input/serio/serio.c')
-rw-r--r-- | drivers/input/serio/serio.c | 16 |
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 | ||
119 | static void serio_bind_driver(struct serio *serio, struct serio_driver *drv) | 119 | static 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 | } |
131 | out: | 143 | out: |
132 | up_write(&serio_bus.subsys.rwsem); | 144 | up_write(&serio_bus.subsys.rwsem); |
133 | } | 145 | } |
134 | 146 | ||