From: Tim Waugh <twaugh@redhat.com>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: linux-kernel@vger.kernel.org
Subject: [patch] 2.4.0: parport device IDs
Date: Fri, 5 Jan 2001 17:19:13 +0000 [thread overview]
Message-ID: <20010105171913.O5253@redhat.com> (raw)
Linus, here is a patch from Adam J. Richter to add the tiny kernel
hook for device-id based parport device driver module loading, as well
as an example usage in lp.c. (The code for making use of it is already
in modutils.)
Tim.
*/
2001-01-05 Adam J. Richter <adam@yggdrasil.com>
* include/linux/parport.h: Declare parport_device_id.
* drivers/char/lp.c: Use it as MODULE_DEVICE_TABLE.
--- linux-2.4.0/include/linux/parport.h.devid Tue Aug 8 13:39:21 2000
+++ linux-2.4.0/include/linux/parport.h Fri Jan 5 10:58:18 2001
@@ -91,6 +91,10 @@
/* Flags for block transfer operations. */
#define PARPORT_EPP_FAST (1<<0) /* Unreliable counts. */
+struct parport_device_id {
+ const char *pattern;
+};
+
/* The rest is for the kernel only */
#ifdef __KERNEL__
--- linux-2.4.0/drivers/char/lp.c.devid Fri Jan 5 10:58:18 2001
+++ linux-2.4.0/drivers/char/lp.c Fri Jan 5 10:58:18 2001
@@ -141,6 +141,17 @@
/* ROUND_UP macro from fs/select.c */
#define ROUND_UP(x,y) (((x)+(y)-1)/(y))
+/* printer_ieee1284_id is declared as its own variable so that it
+ can be in the __initdata section. */
+static __initdata char printer_ieee1284_id[] = "CLS:PRINTER";
+
+static __initdata struct parport_device_id printer_id_tbl[] = {
+ { printer_ieee1284_id },
+ { }
+};
+
+MODULE_DEVICE_TABLE(parport, printer_id_tbl);
+
static devfs_handle_t devfs_handle = NULL;
struct lp_struct lp_table[LP_NO];
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/
reply other threads:[~2001-01-05 17:19 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20010105171913.O5253@redhat.com \
--to=twaugh@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@transmeta.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).