]> www.infradead.org Git - users/willy/xarray.git/commitdiff
lpfc: Convert hba_index to IDA
authorMatthew Wilcox <willy@infradead.org>
Sun, 10 Feb 2019 11:21:25 +0000 (06:21 -0500)
committerMatthew Wilcox (Oracle) <willy@infradead.org>
Thu, 8 Aug 2019 03:39:47 +0000 (23:39 -0400)
Signed-off-by: Matthew Wilcox <willy@infradead.org>
drivers/scsi/lpfc/lpfc_debugfs.c
drivers/scsi/lpfc/lpfc_init.c

index 1ee857d9d16580f64b011135e7dc69270cbbcbd7..16adcd0ce8f9b28affef5df22971ab588130514a 100644 (file)
@@ -24,7 +24,6 @@
 #include <linux/delay.h>
 #include <linux/module.h>
 #include <linux/dma-mapping.h>
-#include <linux/idr.h>
 #include <linux/interrupt.h>
 #include <linux/kthread.h>
 #include <linux/slab.h>
index faf43b1d3dbef626610744daf4d3ecf6220489db..d36cf74bd525505f6c131c9dc1e5c160f65ef406 100644 (file)
@@ -98,7 +98,7 @@ static void lpfc_setup_bg(struct lpfc_hba *, struct Scsi_Host *);
 
 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
 
 /**
@@ -4395,7 +4395,7 @@ destroy_port(struct lpfc_vport *vport)
  * 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.
@@ -4406,7 +4406,7 @@ lpfc_get_instance(void)
 {
        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;
 }
 
@@ -7450,7 +7450,7 @@ lpfc_hba_free(struct lpfc_hba *phba)
                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);
@@ -13522,7 +13522,6 @@ lpfc_exit(void)
                                (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);