Skip to content

Commit

Permalink
[SCSI] fix compile error on module_refcount
Browse files Browse the repository at this point in the history
  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>
  • Loading branch information
Daniel Walker authored and James Bottomley committed Sep 12, 2006
1 parent 2b7cbe2 commit a506b44
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/scsi/scsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -875,10 +875,12 @@ void scsi_device_put(struct scsi_device *sdev)
{
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);
Expand Down

0 comments on commit a506b44

Please sign in to comment.