irqchip/gicv2/3: add gic_retrigger
[firefly-linux-kernel-4.4.55.git] / drivers / scsi / scsi_dh.c
index 0a2168e69bbcd31c91a995dae5439a1485cc0a7d..4d655b568269ee4466bb3b70482a992841058390 100644 (file)
@@ -226,16 +226,20 @@ int scsi_dh_add_device(struct scsi_device *sdev)
 
        drv = scsi_dh_find_driver(sdev);
        if (drv)
-               devinfo = scsi_dh_lookup(drv);
+               devinfo = __scsi_dh_lookup(drv);
        if (devinfo)
                err = scsi_dh_handler_attach(sdev, devinfo);
        return err;
 }
 
-void scsi_dh_remove_device(struct scsi_device *sdev)
+void scsi_dh_release_device(struct scsi_device *sdev)
 {
        if (sdev->handler)
                scsi_dh_handler_detach(sdev);
+}
+
+void scsi_dh_remove_device(struct scsi_device *sdev)
+{
        device_remove_file(&sdev->sdev_gendev, &scsi_dh_state_attr);
 }
 
@@ -285,20 +289,6 @@ int scsi_unregister_device_handler(struct scsi_device_handler *scsi_dh)
 }
 EXPORT_SYMBOL_GPL(scsi_unregister_device_handler);
 
-static struct scsi_device *get_sdev_from_queue(struct request_queue *q)
-{
-       struct scsi_device *sdev;
-       unsigned long flags;
-
-       spin_lock_irqsave(q->queue_lock, flags);
-       sdev = q->queuedata;
-       if (!sdev || !get_device(&sdev->sdev_gendev))
-               sdev = NULL;
-       spin_unlock_irqrestore(q->queue_lock, flags);
-
-       return sdev;
-}
-
 /*
  * scsi_dh_activate - activate the path associated with the scsi_device
  *      corresponding to the given request queue.
@@ -317,7 +307,7 @@ int scsi_dh_activate(struct request_queue *q, activate_complete fn, void *data)
        struct scsi_device *sdev;
        int err = SCSI_DH_NOSYS;
 
-       sdev = get_sdev_from_queue(q);
+       sdev = scsi_device_from_queue(q);
        if (!sdev) {
                if (fn)
                        fn(data, err);
@@ -364,7 +354,7 @@ int scsi_dh_set_params(struct request_queue *q, const char *params)
        struct scsi_device *sdev;
        int err = -SCSI_DH_NOSYS;
 
-       sdev = get_sdev_from_queue(q);
+       sdev = scsi_device_from_queue(q);
        if (!sdev)
                return err;
 
@@ -387,7 +377,7 @@ int scsi_dh_attach(struct request_queue *q, const char *name)
        struct scsi_device_handler *scsi_dh;
        int err = 0;
 
-       sdev = get_sdev_from_queue(q);
+       sdev = scsi_device_from_queue(q);
        if (!sdev)
                return -ENODEV;
 
@@ -425,7 +415,7 @@ const char *scsi_dh_attached_handler_name(struct request_queue *q, gfp_t gfp)
        struct scsi_device *sdev;
        const char *handler_name = NULL;
 
-       sdev = get_sdev_from_queue(q);
+       sdev = scsi_device_from_queue(q);
        if (!sdev)
                return NULL;