Commit a23513e8 authored by Stephen M. Cameron's avatar Stephen M. Cameron Committed by James Bottomley

[SCSI] hpsa: Add an shost_to_hba helper function.

Signed-off-by: default avatarStephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
parent 01fb2187
...@@ -197,6 +197,12 @@ static inline struct ctlr_info *sdev_to_hba(struct scsi_device *sdev) ...@@ -197,6 +197,12 @@ static inline struct ctlr_info *sdev_to_hba(struct scsi_device *sdev)
return (struct ctlr_info *) *priv; return (struct ctlr_info *) *priv;
} }
static inline struct ctlr_info *shost_to_hba(struct Scsi_Host *sh)
{
unsigned long *priv = shost_priv(sh);
return (struct ctlr_info *) *priv;
}
static struct task_struct *hpsa_scan_thread; static struct task_struct *hpsa_scan_thread;
static DEFINE_MUTEX(hpsa_scan_mutex); static DEFINE_MUTEX(hpsa_scan_mutex);
static LIST_HEAD(hpsa_scan_q); static LIST_HEAD(hpsa_scan_q);
...@@ -381,8 +387,7 @@ static ssize_t host_store_rescan(struct device *dev, ...@@ -381,8 +387,7 @@ static ssize_t host_store_rescan(struct device *dev,
{ {
struct ctlr_info *h; struct ctlr_info *h;
struct Scsi_Host *shost = class_to_shost(dev); struct Scsi_Host *shost = class_to_shost(dev);
unsigned long *priv = shost_priv(shost); h = shost_to_hba(shost);
h = (struct ctlr_info *) *priv;
if (add_to_scan_list(h)) { if (add_to_scan_list(h)) {
wake_up_process(hpsa_scan_thread); wake_up_process(hpsa_scan_thread);
wait_for_completion_interruptible(&h->scan_wait); wait_for_completion_interruptible(&h->scan_wait);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment