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>
Tento commit je obsažen v:
Dan Williams
2011-03-31 13:10:44 -07:00
rodič 037afc7812
revize 4393aa4e6b
9 změnil soubory, kde provedl 93 přidání a 218 odebrání

Zobrazit soubor

@@ -233,15 +233,10 @@ static inline void wait_for_device_stop(struct isci_host *ihost, struct isci_rem
wait_event(ihost->eventq, !test_bit(IDEV_STOP_PENDING, &idev->flags));
}
/**
* isci_host_from_sas_ha() - This accessor retrieves the isci_host object
* reference from the Linux sas_ha_struct reference.
* @ha_struct,: This parameter points to the Linux sas_ha_struct object
*
* A reference to the associated isci_host structure.
*/
#define isci_host_from_sas_ha(ha_struct) \
((struct isci_host *)(ha_struct)->lldd_ha)
static inline struct isci_host *dev_to_ihost(struct domain_device *dev)
{
return dev->port->ha->lldd_ha;
}
/**
* isci_host_scan_finished() -