Lines Matching refs:event

250  * Gameport event processing.
270 struct gameport_event *event = NULL;
276 event = list_first_entry(&gameport_event_list,
278 list_del_init(&event->node);
282 return event;
285 static void gameport_free_event(struct gameport_event *event)
287 module_put(event->owner);
288 kfree(event);
291 static void gameport_remove_duplicate_events(struct gameport_event *event)
299 if (event->object == e->object) {
301 * If this event is of different type we should not
305 if (event->type != e->type)
319 struct gameport_event *event;
324 * Note that we handle only one event here to give swsusp
329 if ((event = gameport_get_event())) {
331 switch (event->type) {
334 gameport_add_port(event->object);
338 gameport_attach_driver(event->object);
342 gameport_remove_duplicate_events(event);
343 gameport_free_event(event);
355 struct gameport_event *event;
361 * Scan event list for the other events for the same gameport port,
362 * starting with the most recent one. If event is the same we
363 * do not need add new one. If event is of different type we
364 * need to add this event and should not look further because
367 list_for_each_entry_reverse(event, &gameport_event_list, node) {
368 if (event->object == object) {
369 if (event->type == event_type)
375 event = kmalloc(sizeof(struct gameport_event), GFP_ATOMIC);
376 if (!event) {
377 pr_err("Not enough memory to queue event %d\n", event_type);
383 pr_warn("Can't get module reference, dropping event %d\n",
385 kfree(event);
390 event->type = event_type;
391 event->object = object;
392 event->owner = owner;
394 list_add_tail(&event->node, &gameport_event_list);
408 struct gameport_event *event, *next;
413 list_for_each_entry_safe(event, next, &gameport_event_list, node) {
414 if (event->object == object) {
415 list_del_init(&event->node);
416 gameport_free_event(event);
433 struct gameport_event *event;
439 list_for_each_entry(event, &gameport_event_list, node) {
440 if (event->type == GAMEPORT_REGISTER_PORT) {
441 gameport = event->object;