Commit fc5c3345 authored by Patrick Mochel's avatar Patrick Mochel

- Remove input_handler list; replace with LIST_HEAD(input_handler_list).

- Update all accesses to list to use generic list functions.
parent 66be667c
...@@ -61,8 +61,6 @@ EXPORT_SYMBOL(input_event); ...@@ -61,8 +61,6 @@ EXPORT_SYMBOL(input_event);
static LIST_HEAD(input_dev_list); static LIST_HEAD(input_dev_list);
static LIST_HEAD(input_handler_list); static LIST_HEAD(input_handler_list);
static struct input_handler *input_handler;
static struct input_handler *input_table[8]; static struct input_handler *input_table[8];
static devfs_handle_t input_devfs_handle; static devfs_handle_t input_devfs_handle;
...@@ -445,7 +443,7 @@ static void input_call_hotplug(char *verb, struct input_dev *dev) ...@@ -445,7 +443,7 @@ static void input_call_hotplug(char *verb, struct input_dev *dev)
void input_register_device(struct input_dev *dev) void input_register_device(struct input_dev *dev)
{ {
struct input_handler *handler = input_handler; struct list_head * node;
struct input_handle *handle; struct input_handle *handle;
struct input_device_id *id; struct input_device_id *id;
...@@ -473,12 +471,11 @@ void input_register_device(struct input_dev *dev) ...@@ -473,12 +471,11 @@ void input_register_device(struct input_dev *dev)
/* /*
* Notify handlers. * Notify handlers.
*/ */
list_for_each(node,&input_handler_list) {
while (handler) { struct input_handler *handler = container_of(node,struct input_handler,node);
if ((id = input_match_device(handler->id_table, dev))) if ((id = input_match_device(handler->id_table, dev)))
if ((handle = handler->connect(handler, dev, id))) if ((handle = handler->connect(handler, dev, id)))
input_link_handle(handle); input_link_handle(handle);
handler = handler->next;
} }
/* /*
...@@ -570,9 +567,7 @@ void input_register_handler(struct input_handler *handler) ...@@ -570,9 +567,7 @@ void input_register_handler(struct input_handler *handler)
/* /*
* Add the handler. * Add the handler.
*/ */
list_add_tail(&handler->node,&input_handler_list);
handler->next = input_handler;
input_handler = handler;
/* /*
* Notify it about all existing devices. * Notify it about all existing devices.
...@@ -614,8 +609,7 @@ void input_unregister_handler(struct input_handler *handler) ...@@ -614,8 +609,7 @@ void input_unregister_handler(struct input_handler *handler)
/* /*
* Remove it. * Remove it.
*/ */
input_find_and_remove(struct input_handler, input_handler, handler, list_del_init(&handler->node);
next);
/* /*
* Remove minors. * Remove minors.
...@@ -773,13 +767,14 @@ static int input_devices_read(char *buf, char **start, off_t pos, int count, int ...@@ -773,13 +767,14 @@ static int input_devices_read(char *buf, char **start, off_t pos, int count, int
static int input_handlers_read(char *buf, char **start, off_t pos, int count, int *eof, void *data) static int input_handlers_read(char *buf, char **start, off_t pos, int count, int *eof, void *data)
{ {
struct input_handler *handler = input_handler; struct list_head * node;
off_t at = 0; off_t at = 0;
int len = 0, cnt = 0; int len = 0, cnt = 0;
int i = 0; int i = 0;
while (handler) { list_for_each(node,&input_handler_list) {
struct input_handler *handler = container_of(node,struct input_handler,node);
if (handler->fops) if (handler->fops)
len = sprintf(buf, "N: Number=%d Name=%s Minor=%d\n", len = sprintf(buf, "N: Number=%d Name=%s Minor=%d\n",
...@@ -799,11 +794,9 @@ static int input_handlers_read(char *buf, char **start, off_t pos, int count, in ...@@ -799,11 +794,9 @@ static int input_handlers_read(char *buf, char **start, off_t pos, int count, in
if (cnt >= count) if (cnt >= count)
break; break;
} }
handler = handler->next;
} }
if (node == &input_handler_list)
if (!handler) *eof = 1; *eof = 1;
return (count > cnt) ? cnt : count; return (count > cnt) ? cnt : count;
} }
......
...@@ -871,7 +871,7 @@ struct input_handler { ...@@ -871,7 +871,7 @@ struct input_handler {
struct input_device_id *id_table; struct input_device_id *id_table;
struct input_handle *handle; struct input_handle *handle;
struct input_handler *next; struct list_head node;
}; };
struct input_handle { struct input_handle {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment