Skip to contentSkip to conversation

2.4.0: parport device IDs

PATCH New Tim Waugh 1 participant 1 message Jan 5, 2001

Subsystems (2)
lore
Share & tools
lore

Tim Waugh

author
#0 lore raw

PATCH 1/1 2.4.0: parport device IDs

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 <[email protected]>

* include/linux/parport.h: Declare parport_device_id.
* drivers/char/lp.c: Use it as MODULE_DEVICE_TABLE.

include/linux/parport.h renamed from include/linux/parport.h.devid +4 -0
@@ -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__
 
drivers/char/lp.c renamed from drivers/char/lp.c.devid +11 -0
@@ -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 [email protected]
Please read the FAQ at http://www.tux.org/lkml/