Input layer demand loading

Fredrik Tolf
2003-07-13T16:25:06Z

[-- Attachment #1: Type: text/plain, Size: 110 bytes --]

Why does the input layer still not have on-demand module loading? How about
applying this?

Fredrik Tolf

[-- Attachment #2: Patch for 2.5.75 --]
[-- Type: text/x-diff, Size: 725 bytes --]

cd /usr/src/linux-2.5.75/drivers/input/
diff -up /usr/src/linux-2.5.75/drivers/input/input.c\~ /usr/src/linux-2.5.75/drivers/input/input.c
--- /usr/src/linux-2.5.75/drivers/input/input.c~ 2003-07-13 18:34:09.000000000 +0200
+++ /usr/src/linux-2.5.75/drivers/input/input.c 2003-07-13 18:34:18.000000000 +0200
@@ -531,7 +531,13 @@ static int input_open_file(struct inode
struct file_operations *old_fops, *new_fops = NULL;
int err;

- /* No load-on-demand here? */
+ if(!handler)
+ {
+ char name[20];
+ sprintf(name, "input-dev-%i", minor(inode->i_rdev) >> 5);
+ request_module(name);
+ handler = input_table[minor(inode->i_rdev) >> 5];
+ }
if (!handler || !(new_fops = fops_get(handler->fops)))
return -ENODEV;