Skip to content

Commit a506b44

Browse files
Daniel WalkerJames Bottomley
authored andcommitted
[SCSI] fix compile error on module_refcount
LD .tmp_vmlinux1 drivers/built-in.o(.text+0x8e1f9): In function `scsi_device_put': drivers/scsi/scsi.c:887: undefined reference to `module_refcount' make: *** [.tmp_vmlinux1] Error 1 There are only two users of module_refcount() outside of kernel/module.c and the other one uses ifdef's similar to this. Signed-Off-By: Daniel Walker <dwalker@mvista.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
1 parent 2b7cbe2 commit a506b44

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎drivers/scsi/scsi.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -875,10 +875,12 @@ void scsi_device_put(struct scsi_device *sdev)
875875
{
876876
struct module *module = sdev->host->hostt->module;
877877

878+
#ifdef CONFIG_MODULE_UNLOAD
878879
/* The module refcount will be zero if scsi_device_get()
879880
* was called from a module removal routine */
880881
if (module && module_refcount(module) != 0)
881882
module_put(module);
883+
#endif
882884
put_device(&sdev->sdev_gendev);
883885
}
884886
EXPORT_SYMBOL(scsi_device_put);

0 commit comments

Comments
 (0)