projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c9365bd
)
scsi/lpfc: convert to idr_alloc()
author
Tejun Heo
<
[email protected]
>
Thu, 28 Feb 2013 01:04:44 +0000
(17:04 -0800)
committer
Linus Torvalds
<
[email protected]
>
Thu, 28 Feb 2013 03:10:19 +0000
(19:10 -0800)
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]
>
drivers/scsi/lpfc/lpfc_init.c
patch
|
blob
|
history
diff --git
a/drivers/scsi/lpfc/lpfc_init.c
b/drivers/scsi/lpfc/lpfc_init.c
index 89ad55807012007654e5fb4888ef36ac838016fa..7de4ef14698f37dc05cab98b80845390c0318c59 100644
(file)
--- a/
drivers/scsi/lpfc/lpfc_init.c
+++ b/
drivers/scsi/lpfc/lpfc_init.c
@@
-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;
}
/**