Input layer demand loading

Fredrik Tolf (fredrik@dolda2000.cjb.net)
Sun, 13 Jul 2003 18:39:49 +0200


--------------Boundary-00=_DA2ZQ7K0FMZ5QXS24FC9
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Why does the input layer still not have on-demand module loading? How abo=
ut=20
applying this?

Fredrik Tolf

--------------Boundary-00=_DA2ZQ7K0FMZ5QXS24FC9
Content-Type: text/x-diff;
charset="us-ascii";
name="input.c.patch"
Content-Transfer-Encoding: 7bit
Content-Description: Patch for 2.5.75
Content-Disposition: inline; filename="input.c.patch"

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;

--------------Boundary-00=_DA2ZQ7K0FMZ5QXS24FC9--

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/