]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
[SCSI] hpsa: Add an shost_to_hba helper function.
authorStephen M. Cameron <scameron@beardog.cce.hp.com>
Thu, 4 Feb 2010 14:43:11 +0000 (08:43 -0600)
committerJames Bottomley <James.Bottomley@suse.de>
Wed, 17 Feb 2010 19:22:01 +0000 (13:22 -0600)
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
drivers/scsi/hpsa.c

index 320d6863c44e5954570930c72e9ac9f91946562c..e81df76df8219fde87222916bfd39b4c8c96c6a1 100644 (file)
@@ -197,6 +197,12 @@ static inline struct ctlr_info *sdev_to_hba(struct scsi_device *sdev)
        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 DEFINE_MUTEX(hpsa_scan_mutex);
 static LIST_HEAD(hpsa_scan_q);
@@ -381,8 +387,7 @@ static ssize_t host_store_rescan(struct device *dev,
 {
        struct ctlr_info *h;
        struct Scsi_Host *shost = class_to_shost(dev);
-       unsigned long *priv = shost_priv(shost);
-       h = (struct ctlr_info *) *priv;
+       h = shost_to_hba(shost);
        if (add_to_scan_list(h)) {
                wake_up_process(hpsa_scan_thread);
                wait_for_completion_interruptible(&h->scan_wait);