Subject: L68K: lp-driver-patch
To: linux-m68k@phil.uni-sb.de (linux-list)
Date: Mon, 6 Oct 1997 11:20:13 +0100 (MET)
From: "J." Dorchain <dorchain@gate.moebelwalther.de>
Sender: owner-linux-m68k@phil.uni-sb.de
Reply-To: jdorchain@i-con.de


Hi,

this it needed to use the lp-driver with modules again. It is a diff
against the oldenburg-snapshot (although you see it should apply to any
recent kernel). For the cusious, this make insmod minor=?? work again.
minor is the minor number the driver should try to get, with -1 to let
the kernel choose the next free one.

The symptom that made me find this change was a busserror when starting
lpd. A call trace showed that it was killed during an open(/dev/lp).
A kernel trace showed that it loaded the modules, but didn't initialised
them because insmod returned an error (undefined symbol minor) when
tryting to insert the module.
Short of the story: Is it a kernel bug in the current version to crash
when a module can't be initialised??

Joerg

P.s.: Sorry that it's a little late, but the message somehow went into
the dead.letter file until I found it now.

--- lp_mfc.c.orig	Thu Sep 25 01:27:42 1997
+++ lp_mfc.c	Thu Sep 25 01:28:37 1997
@@ -34,6 +34,7 @@
 
 static volatile int dummy; /* for trigger reads */
 static int minor[MAX_LP] = { -1, -1, -1, -1, -1 };
+MODULE_PARM(minor,"1-5i");
 #ifdef MODULE
 static unsigned int board_key[MAX_LP];
 #endif
 --- lp_intern.c.orig       Thu Sep 25 01:27:42 1997
 +++ lp_intern.c    Thu Sep 25 01:28:37 1997
 @@ -34,6 *34,7 @@
 #include <linux/lp_intern.h>
 
 static int minor = -1;
+MODULE_PARM(minor,"i");
 
 static void lp_int_out(int, int);


