lkml.org 
[lkml]   [2000]   [Dec]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: SCSI modules and kmod
On Thu, Dec 07 2000, strieder@student.uni-kl.de 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 <torben@kernel.dk>
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:
\
 
 \ /
  Last update: 2005-03-22 12:51    [W:0.439 / U:0.308 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site