]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - drivers/scsi/lpfc/lpfc_init.c
Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
[karo-tx-linux.git] / drivers / scsi / lpfc / lpfc_init.c
index 26ca2efa976e4654f8df87d89dcea52d1091bb27..314b4f61b9e3fc73035fbdf48995e34bb31ed4dc 100644 (file)
@@ -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;
 }
 
 /**