[PATCH 3/10] Gameport: connect() is mandatory

Dmitry Torokhov
2005-02-11T07:09:52Z

===================================================================

ChangeSet@1.2151, 2005-02-11 01:18:29-05:00, dtor_core@ameritech.net
Input: make connect and disconnect methods mandatory for gameport
drivers since that's where gameport_{open|close} are called
from to actually bind driver to a port.

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>

gameport.c | 9 ++++-----
1 files changed, 4 insertions(+), 5 deletions(-)

===================================================================

diff -Nru a/drivers/input/gameport/gameport.c b/drivers/input/gameport/gameport.c
--- a/drivers/input/gameport/gameport.c 2005-02-11 01:35:40 -05:00
+++ b/drivers/input/gameport/gameport.c 2005-02-11 01:35:40 -05:00
@@ -107,8 +107,7 @@
list_for_each_entry(drv, &gameport_driver_list, node) {
if (gameport->drv)
break;
- if (drv->connect)
- drv->connect(gameport, drv);
+ drv->connect(gameport, drv);
}
}

@@ -128,7 +127,7 @@
void gameport_unregister_port(struct gameport *gameport)
{
list_del_init(&gameport->node);
- if (gameport->drv && gameport->drv->disconnect)
+ if (gameport->drv)
gameport->drv->disconnect(gameport);
}

@@ -138,7 +137,7 @@

list_add_tail(&drv->node, &gameport_driver_list);
list_for_each_entry(gameport, &gameport_list, node)
- if (!gameport->drv && drv->connect)
+ if (!gameport->drv)
drv->connect(gameport, drv);
}

@@ -148,7 +147,7 @@

list_del_init(&drv->node);
list_for_each_entry(gameport, &gameport_list, node) {
- if (gameport->drv == drv && drv->disconnect)
+ if (gameport->drv == drv)
drv->disconnect(gameport);
gameport_find_driver(gameport);
}