/* This function should be called with the sas_topology_mutex already held  */
static struct mptsas_portinfo* mptsas_find_portinfo_by_handle(MPT_ADAPTER *ioc, u16 handle)
/* This function should be called with the sas_topology_mutex already held  */
static struct mptsas_portinfo* mptsas_find_portinfo_by_handle(MPT_ADAPTER *ioc, u16 handle)
{
	struct mptsas_portinfo *port_info, *rc=NULL;
	int i;
	list_for_each_entry(port_info, &ioc->sas_topology, list)
		for (i = 0; i < port_info->num_phys; i++)
			if (port_info->phy_info[i].identify.handle == handle) {
				rc = port_info;
				goto out;
			}
 out:
	return rc;
}