static struct scsi_transport_template *lpfc_transport_template = NULL;
static struct scsi_transport_template *lpfc_vport_transport_template = NULL;
-static DEFINE_IDR(lpfc_hba_index);
+static DEFINE_IDA(lpfc_hba_index);
#define LPFC_NVMET_BUF_POST 254
/**
* lpfc_get_instance - Get a unique integer ID
*
* This routine allocates a unique integer ID from lpfc_hba_index pool. It
- * uses the kernel idr facility to perform the task.
+ * uses the kernel IDA facility to perform the task.
*
* Return codes:
* instance - a unique integer ID allocated as the new instance.
{
int ret;
- ret = idr_alloc(&lpfc_hba_index, NULL, 0, 0, GFP_KERNEL);
+ ret = ida_alloc(&lpfc_hba_index, GFP_KERNEL);
return ret < 0 ? -1 : ret;
}
kfree(phba->sli4_hba.hdwq);
/* Release the driver assigned board number */
- idr_remove(&lpfc_hba_index, phba->brd_no);
+ ida_free(&lpfc_hba_index, phba->brd_no);
/* Free memory allocated with sli3 rings */
kfree(phba->sli.sli3_ring);
(1L << _dump_buf_dif_order), _dump_buf_dif);
free_pages((unsigned long)_dump_buf_dif, _dump_buf_dif_order);
}
- idr_destroy(&lpfc_hba_index);
}
module_init(lpfc_init);