/* Return code NULL - No vport with the matching @vpi found Otherwise - Address to the vport with the matching @vpi.  */
struct lpfc_vport* lpfc_find_vport_by_vpid(struct lpfc_hba *phba, uint16_t vpi)
/* Return code NULL - No vport with the matching @vpi found Otherwise - Address to the vport with the matching @vpi.  */
struct lpfc_vport* lpfc_find_vport_by_vpid(struct lpfc_hba *phba, uint16_t vpi)
{
	struct lpfc_vport *vport;
	unsigned long flags;
	spin_lock_irqsave(&phba->hbalock, flags);
	list_for_each_entry(vport, &phba->port_list, listentry) {
		if (vport->vpi == vpi) {
			spin_unlock_irqrestore(&phba->hbalock, flags);
			return vport;
		}
	}
	spin_unlock_irqrestore(&phba->hbalock, flags);
	return NULL;
}