scsi: core: Simplify LLD module reference counting
[linux-block.git] / drivers / scsi / scsi_sysfs.c
index 1bc9c26fe1d43dfb64a95919700c0abb405e9917..213ebc88f76ab2d674d0617a6dd6c8819fde74d5 100644 (file)
@@ -452,9 +452,6 @@ static void scsi_device_dev_release_usercontext(struct work_struct *work)
        struct scsi_vpd *vpd_pg0 = NULL, *vpd_pg89 = NULL;
        struct scsi_vpd *vpd_pgb0 = NULL, *vpd_pgb1 = NULL, *vpd_pgb2 = NULL;
        unsigned long flags;
-       struct module *mod;
-
-       mod = sdev->host->hostt->module;
 
        scsi_dh_release_device(sdev);
 
@@ -521,17 +518,11 @@ static void scsi_device_dev_release_usercontext(struct work_struct *work)
 
        if (parent)
                put_device(parent);
-       module_put(mod);
 }
 
 static void scsi_device_dev_release(struct device *dev)
 {
        struct scsi_device *sdp = to_scsi_device(dev);
-
-       /* Set module pointer as NULL in case of module unloading */
-       if (!try_module_get(sdp->host->hostt->module))
-               sdp->host->hostt->module = NULL;
-
        execute_in_process_context(scsi_device_dev_release_usercontext,
                                   &sdp->ew);
 }