Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ab516036 authored by Tejun Heo's avatar Tejun Heo Committed by Linus Torvalds
Browse files

scsi/lpfc: convert to idr_alloc()



Convert to the much saner new idr interface.

Signed-off-by: default avatarTejun Heo <tj@kernel.org>
Acked-by: default avatarJames Smart <james.smart@emulex.com>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent c9365bd0
Loading
Loading
Loading
Loading
+4 −8
Original line number Diff line number Diff line
@@ -3165,14 +3165,10 @@ destroy_port(struct lpfc_vport *vport)
int
lpfc_get_instance(void)
{
	int instance = 0;

	/* Assign an unused number */
	if (!idr_pre_get(&lpfc_hba_index, GFP_KERNEL))
		return -1;
	if (idr_get_new(&lpfc_hba_index, NULL, &instance))
		return -1;
	return instance;
	int ret;

	ret = idr_alloc(&lpfc_hba_index, NULL, 0, 0, GFP_KERNEL);
	return ret < 0 ? -1 : ret;
}

/**