X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=drivers%2Finput%2Fgameport%2Fgameport.c;h=caac6d63d46f4a7da7ffc70293aad635d7c6bb37;hb=9e50afd0cb3ff9ee152dbcf8601f5fb7eba5cff8;hp=ab09cf4093e32595cbd84824db790e73f91d2881;hpb=717cb906bd43a9ac00631d600adda5c6546843a6;p=linux-2.6 diff --git a/drivers/input/gameport/gameport.c b/drivers/input/gameport/gameport.c index ab09cf4093..caac6d63d4 100644 --- a/drivers/input/gameport/gameport.c +++ b/drivers/input/gameport/gameport.c @@ -21,6 +21,7 @@ #include #include #include +#include /* HZ */ /*#include */ @@ -338,14 +339,20 @@ static struct gameport_event *gameport_get_event(void) return event; } -static void gameport_handle_events(void) +static void gameport_handle_event(void) { struct gameport_event *event; struct gameport_driver *gameport_drv; down(&gameport_sem); - while ((event = gameport_get_event())) { + /* + * Note that we handle only one event here to give swsusp + * a chance to freeze kgameportd thread. Gameport events + * should be pretty rare so we are not concerned about + * taking performance hit. + */ + if ((event = gameport_get_event())) { switch (event->type) { case GAMEPORT_REGISTER_PORT: @@ -432,7 +439,7 @@ static struct gameport *gameport_get_pending_child(struct gameport *parent) static int gameport_thread(void *nothing) { do { - gameport_handle_events(); + gameport_handle_event(); wait_event_interruptible(gameport_wait, kthread_should_stop() || !list_empty(&gameport_event_list)); try_to_freeze();