diff options
author | Alex Shi <alex.shi@linaro.org> | 2017-03-20 12:03:13 +0800 |
---|---|---|
committer | Alex Shi <alex.shi@linaro.org> | 2017-03-20 12:03:13 +0800 |
commit | 89e7fad96be88f30f491bf227d864bf5e8e701b2 (patch) | |
tree | 6316161ebd26b780991ff8632471fbbfa3af7ea8 /drivers/scsi/scsi_dh.c | |
parent | 5b0250d2571ee75ca3c0b34579c3e90bc2bd9c6a (diff) | |
parent | 1c563c0006661025d7a6c9bc85fc889a4e8a1c06 (diff) |
Merge branch 'linux-linaro-lsk-v4.4' into linux-linaro-lsk-v4.4-rtlsk-v4.4-17.09-rtlsk-v4.4-17.08-rtlsk-v4.4-17.07-rtlsk-v4.4-17.06-rtlsk-v4.4-17.05-rtlsk-v4.4-17.03-rt
Diffstat (limited to 'drivers/scsi/scsi_dh.c')
-rw-r--r-- | drivers/scsi/scsi_dh.c | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/drivers/scsi/scsi_dh.c b/drivers/scsi/scsi_dh.c index e7649ed3f667..4d655b568269 100644 --- a/drivers/scsi/scsi_dh.c +++ b/drivers/scsi/scsi_dh.c @@ -289,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. @@ -321,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); @@ -368,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; @@ -391,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; @@ -429,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; |