scsi/lpfc: convert to idr_alloc()

Convert to the much saner new idr interface.

Signed-off-by: Tejun Heo <[email protected]>
Acked-by: James Smart <[email protected]>
Cc: James Bottomley <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
Tejun Heo 2013-02-27 17:04:44 -08:00 • committed by Linus Torvalds
commit ab51603672

View file

@ -3165,14 +3165,10 @@ destroy_port(struct lpfc_vport *vport)
int
lpfc_get_instance(void)
{
int instance = 0;
int ret;
/* 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;
ret = idr_alloc(&lpfc_hba_index, NULL, 0, 0, GFP_KERNEL);
return ret < 0 ? -1 : ret;
}
/**