diff options
author | Tejun Heo <tj@kernel.org> | 2013-02-27 20:04:41 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-02-27 22:10:18 -0500 |
commit | 70a9755d5fe71d9ecf3010c5c345449378fb0898 (patch) | |
tree | a529b0e14e9d5f9841b24b82d816569f5534e303 /drivers/scsi/bfa/bfad_im.c | |
parent | d0ffce779d667ec0684309797c187846cedab6d4 (diff) |
scsi/bfa: convert to idr_alloc()
Convert to the much saner new idr interface.
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Krishna C Gudipati <kgudipat@brocade.com>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/scsi/bfa/bfad_im.c')
-rw-r--r-- | drivers/scsi/bfa/bfad_im.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/drivers/scsi/bfa/bfad_im.c b/drivers/scsi/bfa/bfad_im.c index 8f92732655c7..5864f987f206 100644 --- a/drivers/scsi/bfa/bfad_im.c +++ b/drivers/scsi/bfa/bfad_im.c | |||
@@ -523,20 +523,13 @@ bfad_im_scsi_host_alloc(struct bfad_s *bfad, struct bfad_im_port_s *im_port, | |||
523 | int error = 1; | 523 | int error = 1; |
524 | 524 | ||
525 | mutex_lock(&bfad_mutex); | 525 | mutex_lock(&bfad_mutex); |
526 | if (!idr_pre_get(&bfad_im_port_index, GFP_KERNEL)) { | 526 | error = idr_alloc(&bfad_im_port_index, im_port, 0, 0, GFP_KERNEL); |
527 | if (error < 0) { | ||
527 | mutex_unlock(&bfad_mutex); | 528 | mutex_unlock(&bfad_mutex); |
528 | printk(KERN_WARNING "idr_pre_get failure\n"); | 529 | printk(KERN_WARNING "idr_alloc failure\n"); |
529 | goto out; | 530 | goto out; |
530 | } | 531 | } |
531 | 532 | im_port->idr_id = error; | |
532 | error = idr_get_new(&bfad_im_port_index, im_port, | ||
533 | &im_port->idr_id); | ||
534 | if (error) { | ||
535 | mutex_unlock(&bfad_mutex); | ||
536 | printk(KERN_WARNING "idr_get_new failure\n"); | ||
537 | goto out; | ||
538 | } | ||
539 | |||
540 | mutex_unlock(&bfad_mutex); | 533 | mutex_unlock(&bfad_mutex); |
541 | 534 | ||
542 | im_port->shost = bfad_scsi_host_alloc(im_port, bfad); | 535 | im_port->shost = bfad_scsi_host_alloc(im_port, bfad); |