diff options
author | Dan Williams <dan.j.williams@intel.com> | 2011-03-31 16:10:44 -0400 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2011-07-03 07:00:36 -0400 |
commit | 4393aa4e6b9517a666f0ef6b774fd421a9dc4c68 (patch) | |
tree | ec5e0c222d16f2368e5589a11fc4ec191ceca365 /drivers/scsi/isci/host.h | |
parent | 037afc7812e2b202fbc18218e6c0eff34dad36ed (diff) |
isci: fix fragile/conditional isci_host lookups
A domain_device can always reference back to ->lldd_ha unlike local lldd
structures. Fix up cases where the driver uses local objects to look up the
isci_host. This also changes the calling conventions of some routines to
expect a valid isci_host parameter rather than re-lookup the pointer on entry.
Incidentally cleans up some macros that are longer to type than the open-coded
equivalent:
isci_host_from_sas_ha
isci_dev_from_domain_dev
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/scsi/isci/host.h')
-rw-r--r-- | drivers/scsi/isci/host.h | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/scsi/isci/host.h b/drivers/scsi/isci/host.h index d012b69d8d61..8372094ef5ad 100644 --- a/drivers/scsi/isci/host.h +++ b/drivers/scsi/isci/host.h | |||
@@ -233,15 +233,10 @@ static inline void wait_for_device_stop(struct isci_host *ihost, struct isci_rem | |||
233 | wait_event(ihost->eventq, !test_bit(IDEV_STOP_PENDING, &idev->flags)); | 233 | wait_event(ihost->eventq, !test_bit(IDEV_STOP_PENDING, &idev->flags)); |
234 | } | 234 | } |
235 | 235 | ||
236 | /** | 236 | static inline struct isci_host *dev_to_ihost(struct domain_device *dev) |
237 | * isci_host_from_sas_ha() - This accessor retrieves the isci_host object | 237 | { |
238 | * reference from the Linux sas_ha_struct reference. | 238 | return dev->port->ha->lldd_ha; |
239 | * @ha_struct,: This parameter points to the Linux sas_ha_struct object | 239 | } |
240 | * | ||
241 | * A reference to the associated isci_host structure. | ||
242 | */ | ||
243 | #define isci_host_from_sas_ha(ha_struct) \ | ||
244 | ((struct isci_host *)(ha_struct)->lldd_ha) | ||
245 | 240 | ||
246 | /** | 241 | /** |
247 | * isci_host_scan_finished() - | 242 | * isci_host_scan_finished() - |