/* Returns: matching lport pointer or NULL if there is no match  */
struct fc_lport* fc_vport_id_lookup(struct fc_lport *n_port, u32 port_id)
/* Returns: matching lport pointer or NULL if there is no match  */
struct fc_lport* fc_vport_id_lookup(struct fc_lport *n_port, u32 port_id)
{
	struct fc_lport *lport = NULL;
	struct fc_lport *vn_port;
	if (fc_host_port_id(n_port->host) == port_id)
		return n_port;
	mutex_lock(&n_port->lp_mutex);
	list_for_each_entry(vn_port, &n_port->vports, list) {
		if (fc_host_port_id(vn_port->host) == port_id) {
			lport = vn_port;
			break;
		}
	}
	mutex_unlock(&n_port->lp_mutex);
	return lport;
}