[PATCH 32/47] make connect and disconnect methods mandatory for serio

Vojtech Pavlik
2004-07-29T14:34:49Z

ChangeSet@1.1757.15.27, 2004-06-29 01:25:59-05:00, dtor_core@ameritech.net
Input: make connect and disconnect methods mandatory for serio
drivers since that's where serio_{open|close} are called
from to actually bind driver to a port.

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

serio.c | 11 +++++------
1 files changed, 5 insertions(+), 6 deletions(-)

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

diff -Nru a/drivers/input/serio/serio.c b/drivers/input/serio/serio.c
--- a/drivers/input/serio/serio.c Thu Jul 29 14:39:41 2004
+++ b/drivers/input/serio/serio.c Thu Jul 29 14:39:41 2004
@@ -68,8 +68,7 @@
list_for_each_entry(dev, &serio_dev_list, node) {
if (serio->dev)
break;
- if (dev->connect)
- dev->connect(serio, dev);
+ dev->connect(serio, dev);
}
}

@@ -160,7 +159,7 @@
/* reconnect failed - fall through to rescan */

case SERIO_RESCAN :
- if (event->serio->dev && event->serio->dev->disconnect)
+ if (event->serio->dev)
event->serio->dev->disconnect(event->serio);
serio_find_dev(event->serio);
break;
@@ -282,7 +281,7 @@
{
serio_remove_pending_events(serio);
list_del_init(&serio->node);
- if (serio->dev && serio->dev->disconnect)
+ if (serio->dev)
serio->dev->disconnect(serio);
}

@@ -296,7 +295,7 @@
down(&serio_sem);
list_add_tail(&dev->node, &serio_dev_list);
list_for_each_entry(serio, &serio_list, node)
- if (!serio->dev && dev->connect)
+ if (!serio->dev)
dev->connect(serio, dev);
up(&serio_sem);
}
@@ -309,7 +308,7 @@
list_del_init(&dev->node);

list_for_each_entry(serio, &serio_list, node) {
- if (serio->dev == dev && dev->disconnect)
+ if (serio->dev == dev)
dev->disconnect(serio);
serio_find_dev(serio);
}