All of lore.kernel.org
 help / color / mirror / Atom feed
From: Duncan Palmer <dunk.palmer@gmail.com>
To: kernel-janitors@vger.kernel.org
Subject: Re: [KJ] Fwd: I noticed these
Date: Tue, 01 Feb 2005 01:00:00 +0000	[thread overview]
Message-ID: <72dff67005013117001692d749@mail.gmail.com> (raw)

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

(sorry for not replying to the original post - I've just joined the list)

Randy Dunlap wrote:

> 1. Psmouse and input event drivers don't have module alias autoload 
> support. I think it should be possible to do this similar to how 
> misc_device works.

I've just been having a look at this, and have attached an example
patch (untested, and only partial) - does this look like the right
approach? The various input event drivers each use a range of minor
numbers, so if people think I'm doing the right thing so far, I'll
take these into account when I finish my changes.

2. /proc interface in /dev/rtc doesn't seem to have MODULE_OWNER ref 
counting.

No idea about this. SET_MODULE_OWNER is defined to a no-op, and I
can't find any info as to its purpose. Can anyone enlighten me?

Dunk

[-- Attachment #2: diff --]
[-- Type: application/octet-stream, Size: 1798 bytes --]

diff -u linux-2.6.11-rc2-mm1.orig/include/linux/input.h linux-2.6.11-rc2-mm1/include/linux/input.h
--- linux-2.6.11-rc2-mm1.orig/include/linux/input.h	2005-01-28 13:01:08.000000000 +1100
+++ linux-2.6.11-rc2-mm1/include/linux/input.h	2005-02-01 11:32:40.000000000 +1100
@@ -1012,5 +1012,9 @@
 
 extern struct class_simple *input_class;
 
+#define MODULE_ALIAS_INPUT(minorbase)  \
+	MODULE_ALIAS("char-major-" __stringify(INPUT_MAJOR) "-" \
+            __stringify(minorbase))
+
 #endif
 #endif
diff -u linux-2.6.11-rc2-mm1.orig/drivers/input/input.c linux-2.6.11-rc2-mm1/drivers/input/input.c
--- linux-2.6.11-rc2-mm1.orig/drivers/input/input.c	2005-01-28 13:00:29.000000000 +1100
+++ linux-2.6.11-rc2-mm1/drivers/input/input.c	2005-02-01 11:40:44.000000000 +1100
@@ -536,8 +536,13 @@
 	struct file_operations *old_fops, *new_fops = NULL;
 	int err;
 
-	/* No load-on-demand here? */
-	if (!handler || !(new_fops = fops_get(handler->fops)))
+	if (!handler)
+    {
+        request_module("char-major-%d-%d", INPUT_MAJOR, iminor(inode));
+		/* The module will register itself upon loading */
+		handler = input_table[iminor(inode) >> 5];
+    }
+    if (!handler || !(new_fops = fops_get(handler->fops)))
 		return -ENODEV;
 
 	/*
diff -u linux-2.6.11-rc2-mm1.orig/drivers/input/mousedev.c linux-2.6.11-rc2-mm1/drivers/input/mousedev.c
--- linux-2.6.11-rc2-mm1.orig/drivers/input/mousedev.c	2005-01-28 13:00:30.000000000 +1100
+++ linux-2.6.11-rc2-mm1/drivers/input/mousedev.c	2005-02-01 11:32:53.000000000 +1100
@@ -32,6 +32,7 @@
 MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>");
 MODULE_DESCRIPTION("Mouse (ExplorerPS/2) device interfaces");
 MODULE_LICENSE("GPL");
+MODULE_ALIAS_INPUT(MOUSEDEV_MINOR_BASE);
 
 #ifndef CONFIG_INPUT_MOUSEDEV_SCREEN_X
 #define CONFIG_INPUT_MOUSEDEV_SCREEN_X	1024

[-- Attachment #3: Type: text/plain, Size: 167 bytes --]

_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors

             reply	other threads:[~2005-02-01  1:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-01  1:00 Duncan Palmer [this message]
  -- strict thread matches above, loose matches on Subject: below --
2005-01-27 22:35 [KJ] Fwd: I noticed these Randy.Dunlap

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=72dff67005013117001692d749@mail.gmail.com \
    --to=dunk.palmer@gmail.com \
    --cc=kernel-janitors@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.