On Thu, Dec 07 2000, [EMAIL PROTECTED] wrote:

[deleted]
 
>     int regdevresult;
> ....
>     case MODULE_SCSI_DEV:
> #ifdef CONFIG_KMOD
>         if (scsi_hosts == NULL)
>           {
>             request_module("scsi_hostadapter");
>             return scsi_register_device_module((struct
> Scsi_Device_Template *) ptr);
>           }
> #endif
>         regdevresult = scsi_register_device_module((struct
> Scsi_Device_Template *) ptr);
> #ifdef CONFIG_KMOD
>         if (regdevresult != 0) /* is this the right case? */
>             request_module("scsi_hostadapter");
>         regdevresult = scsi_register_device_module((struct
> Scsi_Device_Template *) ptr);
> #endif
>         return regdevresult;
> 
This won't work. scsi_register_device_module returns 0 when the 
driver loads ok, not when a device was actually found. Remember
its possible to load the sd driver with no host adapter present.

How about just removing the check for scsi_hosts == NULL. If some
hostadapter was already loaded, so be it. It won't change anything,
besides maybe more devices beeing loaded which shouldn't hurt anyone.

Small patch attached (against t12p7). Not tested, not even compiled.


-- 
Torben Mathiasen <[EMAIL PROTECTED]>
Linux ThunderLAN maintainer 
http://tlan.kernel.dk
--- /opt/kernel/kernels/linux/drivers/scsi/scsi.c       Wed Nov  1 15:04:02 2000
+++ linux/drivers/scsi/scsi.c   Fri Dec  8 02:13:47 2000
@@ -2322,11 +2322,9 @@
                /* Load upper level device handler of some kind */
        case MODULE_SCSI_DEV:
 #ifdef CONFIG_KMOD
-               if (scsi_hosts == NULL)
-                       request_module("scsi_hostadapter");
+       request_module("scsi_hostadapter");
 #endif
-               return scsi_register_device_module((struct Scsi_Device_Template *) 
ptr);
-               /* The rest of these are not yet implemented */
+       return scsi_register_device_module((struct Scsi_Device_Template *) ptr);
 
                /* Load constants.o */
        case MODULE_SCSI_CONST:

Reply via email to