aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2009-04-13 18:27:49 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2009-04-15 11:58:19 -0400
commit4ced8e7cb990a2c3bbf0ac7f27b35c890e7ce895 (patch)
tree17d4f49178ec7c407b876796ac0c6d57ea9a80b7 /drivers/input
parentd061ebd57a046b3df8be8b76c387a95171059244 (diff)
Input: gameport - fix attach driver code
The commit 6902c0bead4ce266226fc0c5b3828b850bdc884a that moved driver registration out of kgameportd thread was incomplete and did not add the code necessary to actually attach driver to already registered devices, rectify that. Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/gameport/gameport.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/input/gameport/gameport.c b/drivers/input/gameport/gameport.c
index ebf4be5b7c4e..2d175b5928ff 100644
--- a/drivers/input/gameport/gameport.c
+++ b/drivers/input/gameport/gameport.c
@@ -50,9 +50,8 @@ static LIST_HEAD(gameport_list);
50 50
51static struct bus_type gameport_bus; 51static struct bus_type gameport_bus;
52 52
53static void gameport_add_driver(struct gameport_driver *drv);
54static void gameport_add_port(struct gameport *gameport); 53static void gameport_add_port(struct gameport *gameport);
55static void gameport_destroy_port(struct gameport *gameport); 54static void gameport_attach_driver(struct gameport_driver *drv);
56static void gameport_reconnect_port(struct gameport *gameport); 55static void gameport_reconnect_port(struct gameport *gameport);
57static void gameport_disconnect_port(struct gameport *gameport); 56static void gameport_disconnect_port(struct gameport *gameport);
58 57
@@ -230,7 +229,6 @@ static void gameport_find_driver(struct gameport *gameport)
230 229
231enum gameport_event_type { 230enum gameport_event_type {
232 GAMEPORT_REGISTER_PORT, 231 GAMEPORT_REGISTER_PORT,
233 GAMEPORT_REGISTER_DRIVER,
234 GAMEPORT_ATTACH_DRIVER, 232 GAMEPORT_ATTACH_DRIVER,
235}; 233};
236 234
@@ -374,8 +372,8 @@ static void gameport_handle_event(void)
374 gameport_add_port(event->object); 372 gameport_add_port(event->object);
375 break; 373 break;
376 374
377 case GAMEPORT_REGISTER_DRIVER: 375 case GAMEPORT_ATTACH_DRIVER:
378 gameport_add_driver(event->object); 376 gameport_attach_driver(event->object);
379 break; 377 break;
380 378
381 default: 379 default:
@@ -706,14 +704,14 @@ static int gameport_driver_remove(struct device *dev)
706 return 0; 704 return 0;
707} 705}
708 706
709static void gameport_add_driver(struct gameport_driver *drv) 707static void gameport_attach_driver(struct gameport_driver *drv)
710{ 708{
711 int error; 709 int error;
712 710
713 error = driver_register(&drv->driver); 711 error = driver_attach(&drv->driver);
714 if (error) 712 if (error)
715 printk(KERN_ERR 713 printk(KERN_ERR
716 "gameport: driver_register() failed for %s, error: %d\n", 714 "gameport: driver_attach() failed for %s, error: %d\n",
717 drv->driver.name, error); 715 drv->driver.name, error);
718} 716}
719 717