Re: SCSI modules and kmod

From: Torben Mathiasen (torben@kernel.dk)
Date: Thu Dec 07 2000 - 20:30:07 EST


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


- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu Dec 07 2000 - 21:00:19 EST