From: Andy Whitcroft BODGE scsi misc module reference count checks with no MODULE_UNLOAD A quick bodge to try and get this to compile for testing. Signed-off-by: Andy Whitcroft Cc: James Bottomley Signed-off-by: Andrew Morton --- drivers/scsi/scsi.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff -puN drivers/scsi/scsi.c~bodge-scsi-misc-module-reference-count-checks-with-no-module_unload drivers/scsi/scsi.c --- a/drivers/scsi/scsi.c~bodge-scsi-misc-module-reference-count-checks-with-no-module_unload +++ a/drivers/scsi/scsi.c @@ -876,7 +876,11 @@ void scsi_device_put(struct scsi_device #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) + if (module +#ifdef CONFIG_MODULE_UNLOAD + && module_refcount(module) != 0 +#endif + ) module_put(module); #endif put_device(&sdev->sdev_gendev); _