Lines Matching refs:event
251 * Gameport event processing.
271 struct gameport_event *event = NULL;
277 event = list_first_entry(&gameport_event_list,
279 list_del_init(&event->node);
283 return event;
286 static void gameport_free_event(struct gameport_event *event)
288 module_put(event->owner);
289 kfree(event);
292 static void gameport_remove_duplicate_events(struct gameport_event *event)
300 if (event->object == e->object) {
302 * If this event is of different type we should not
306 if (event->type != e->type)
320 struct gameport_event *event;
325 * Note that we handle only one event here to give swsusp
330 if ((event = gameport_get_event())) {
332 switch (event->type) {
335 gameport_add_port(event->object);
339 gameport_attach_driver(event->object);
343 gameport_remove_duplicate_events(event);
344 gameport_free_event(event);
356 struct gameport_event *event;
362 * Scan event list for the other events for the same gameport port,
363 * starting with the most recent one. If event is the same we
364 * do not need add new one. If event is of different type we
365 * need to add this event and should not look further because
368 list_for_each_entry_reverse(event, &gameport_event_list, node) {
369 if (event->object == object) {
370 if (event->type == event_type)
376 event = kmalloc(sizeof(struct gameport_event), GFP_ATOMIC);
377 if (!event) {
378 pr_err("Not enough memory to queue event %d\n", event_type);
384 pr_warn("Can't get module reference, dropping event %d\n",
386 kfree(event);
391 event->type = event_type;
392 event->object = object;
393 event->owner = owner;
395 list_add_tail(&event->node, &gameport_event_list);
409 struct gameport_event *event, *next;
414 list_for_each_entry_safe(event, next, &gameport_event_list, node) {
415 if (event->object == object) {
416 list_del_init(&event->node);
417 gameport_free_event(event);
434 struct gameport_event *event;
440 list_for_each_entry(event, &gameport_event_list, node) {
441 if (event->type == GAMEPORT_REGISTER_PORT) {
442 gameport = event->object;