|
@@ -986,9 +986,9 @@ int scsi_device_get(struct scsi_device *sdev)
|
|
|
return -ENXIO;
|
|
|
if (!get_device(&sdev->sdev_gendev))
|
|
|
return -ENXIO;
|
|
|
- /* We can fail this if we're doing SCSI operations
|
|
|
+ /* We can fail try_module_get if we're doing SCSI operations
|
|
|
* from module exit (like cache flush) */
|
|
|
- try_module_get(sdev->host->hostt->module);
|
|
|
+ __module_get(sdev->host->hostt->module);
|
|
|
|
|
|
return 0;
|
|
|
}
|
|
@@ -1004,14 +1004,7 @@ EXPORT_SYMBOL(scsi_device_get);
|
|
|
*/
|
|
|
void scsi_device_put(struct scsi_device *sdev)
|
|
|
{
|
|
|
-#ifdef CONFIG_MODULE_UNLOAD
|
|
|
- struct module *module = sdev->host->hostt->module;
|
|
|
-
|
|
|
- /* 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
|
|
|
+ module_put(sdev->host->hostt->module);
|
|
|
put_device(&sdev->sdev_gendev);
|
|
|
}
|
|
|
EXPORT_SYMBOL(scsi_device_put);
|