[PARPORT] ppa patch


Andrea Arcangeli (arcangeli@mbox.queen.it)
Thu, 7 May 1998 16:39:26 +0200 (CEST)


Here a little ppa patch against 2.1.100-3 that take care of:

1. parport_enumerate() must be recalled also if KMOD is not compiled in
   the kernel.

2. There is no need to make a request_module() inside ppa since the
   parport lowlevel module is loaded automagically by parport_enumerate().

3. We don' t need to initialize the ppa base address cache at every
   ppa_pb_claim() request since the port->base address can' t change at
   runtime, it can change only when ppa in not loaded.

Andrea[s] Arcangeli

--- linux/drivers/scsi/ppa.c 1998/05/07 14:06:44 1.1
+++ linux/drivers/scsi/ppa.c 1998/05/07 14:23:33
@@ -50,13 +50,6 @@
 #include "ppa.h"
 #include <linux/parport.h>
 
-#ifdef CONFIG_KMOD
-#include <linux/kmod.h>
-#ifndef PARPORT_MODULES
-#define PARPORT_MODULES "parport_pc"
-#endif
-#endif
-
 #define NO_HOSTS 4
 static ppa_struct ppa_hosts[NO_HOSTS] =
 {PPA_EMPTY, PPA_EMPTY, PPA_EMPTY, PPA_EMPTY};
@@ -98,7 +91,6 @@
         return 1;
     }
 
- PPA_BASE(host_no) = ppa_hosts[host_no].dev->port->base;
     if (ppa_hosts[host_no].cur_cmd)
         ppa_hosts[host_no].cur_cmd->SCp.phase++;
     return 0;
@@ -130,12 +122,8 @@
     nhosts = 0;
     try_again = 0;
 
-#ifdef CONFIG_KMOD
- if (!pb) {
- request_module(PARPORT_MODULES);
+ if (!pb)
         pb = parport_enumerate();
- }
-#endif
 
     if (!pb) {
         printk("ppa: parport reports no devices.\n");
@@ -155,7 +143,7 @@
         if (ppa_pb_claim(i))
             while (ppa_hosts[i].p_busy)
                 schedule(); /* Whe can safe schedule() here */
- ppb = PPA_BASE(i);
+ ppb = PPA_BASE(i) = ppa_hosts[i].dev->port->base;
         w_ctr(ppb, 0x0c);
         modes = ppa_hosts[i].dev->port->modes;
 

-- To unsubscribe, send mail to: linux-parport-request@torque.net --
-- with the single word "unsubscribe" in the body of the message. --



This archive was generated by hypermail 2.0b3 on Wed 30 Dec 1998 - 10:17:42 EST