scsi/lpfc: convert to idr_alloc()
Convert to the much saner new idr interface. Signed-off-by: Tejun Heo <tj@kernel.org> Acked-by: James Smart <james.smart@emulex.com> Cc: James Bottomley <James.Bottomley@HansenPartnership.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
c9365bd028
commit
ab51603672
@ -3165,14 +3165,10 @@ destroy_port(struct lpfc_vport *vport)
|
|||||||
int
|
int
|
||||||
lpfc_get_instance(void)
|
lpfc_get_instance(void)
|
||||||
{
|
{
|
||||||
int instance = 0;
|
int ret;
|
||||||
|
|
||||||
/* Assign an unused number */
|
ret = idr_alloc(&lpfc_hba_index, NULL, 0, 0, GFP_KERNEL);
|
||||||
if (!idr_pre_get(&lpfc_hba_index, GFP_KERNEL))
|
return ret < 0 ? -1 : ret;
|
||||||
return -1;
|
|
||||||
if (idr_get_new(&lpfc_hba_index, NULL, &instance))
|
|
||||||
return -1;
|
|
||||||
return instance;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user