Skip to contentSkip to conversation

scsi: compile error on module_refcount

PATCH In review [email protected] 2 participants 3 messages Sep 9, 2006 SCSI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scsi: compile error on module_refcount

Fixes the following compile error,

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.

---
 drivers/scsi/scsi.c |    2 ++
 1 files changed, 2 insertions(+)
drivers/scsi/scsi.c +2 -0
Index: linux-2.6.17/drivers/scsi/scsi.c
===================================================================
@@ -882,10 +882,12 @@ void scsi_device_put(struct scsi_device 
 {
 	struct module *module = sdev->host->hostt->module;
 
+#ifdef CONFIG_MODULE_UNLOAD
 	/* The module refcount will be zero if scsi_device_get()
 	 * was called from a module removal routine */
 	if (module && module_refcount(module) != 0)
 		module_put(module);
+#endif
 	put_device(&sdev->sdev_gendev);
 }
 EXPORT_SYMBOL(scsi_device_put);

--

#1 lore raw
Quoted 10 lines · On Sat, 2006-09-09 at 09:26 -0700, [email protected] wrote:

Fixes the following compile error,

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.

of course,

#2 lore raw

Thanks for the patch.

On Sat, 2006-09-09 at 09:31 -0700, Daniel Walker wrote

Quoted 1 line

for future reference, SCSI patches should go to [email protected], since most people who read and review them don't actually subscribe to lkml.

James