Skip to content

Commit 4ced8e7

Browse files
committed
Input: gameport - fix attach driver code
The commit 6902c0b 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>
1 parent d061ebd commit 4ced8e7

1 file changed

Lines changed: 6 additions & 8 deletions

File tree

‎drivers/input/gameport/gameport.c‎

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,8 @@ static LIST_HEAD(gameport_list);
5050

5151
static struct bus_type gameport_bus;
5252

53-
static void gameport_add_driver(struct gameport_driver *drv);
5453
static void gameport_add_port(struct gameport *gameport);
55-
static void gameport_destroy_port(struct gameport *gameport);
54+
static void gameport_attach_driver(struct gameport_driver *drv);
5655
static void gameport_reconnect_port(struct gameport *gameport);
5756
static void gameport_disconnect_port(struct gameport *gameport);
5857

@@ -230,7 +229,6 @@ static void gameport_find_driver(struct gameport *gameport)
230229

231230
enum gameport_event_type {
232231
GAMEPORT_REGISTER_PORT,
233-
GAMEPORT_REGISTER_DRIVER,
234232
GAMEPORT_ATTACH_DRIVER,
235233
};
236234

@@ -374,8 +372,8 @@ static void gameport_handle_event(void)
374372
gameport_add_port(event->object);
375373
break;
376374

377-
case GAMEPORT_REGISTER_DRIVER:
378-
gameport_add_driver(event->object);
375+
case GAMEPORT_ATTACH_DRIVER:
376+
gameport_attach_driver(event->object);
379377
break;
380378

381379
default:
@@ -706,14 +704,14 @@ static int gameport_driver_remove(struct device *dev)
706704
return 0;
707705
}
708706

709-
static void gameport_add_driver(struct gameport_driver *drv)
707+
static void gameport_attach_driver(struct gameport_driver *drv)
710708
{
711709
int error;
712710

713-
error = driver_register(&drv->driver);
711+
error = driver_attach(&drv->driver);
714712
if (error)
715713
printk(KERN_ERR
716-
"gameport: driver_register() failed for %s, error: %d\n",
714+
"gameport: driver_attach() failed for %s, error: %d\n",
717715
drv->driver.name, error);
718716
}
719717

0 commit comments

Comments
 (0)