lkml.org 
[lkml]   [2013]   [Feb]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 60/77] scsi/bfa: convert to idr_alloc()
    Date
    Convert to the much saner new idr interface.

    Only compile tested.

    Signed-off-by: Tejun Heo <tj@kernel.org>
    Cc: Krishna C Gudipati <kgudipat@brocade.com>
    Cc: linux-scsi@vger.kernel.org
    ---
    drivers/scsi/bfa/bfad_im.c | 15 ++++-----------
    1 file changed, 4 insertions(+), 11 deletions(-)

    diff --git a/drivers/scsi/bfa/bfad_im.c b/drivers/scsi/bfa/bfad_im.c
    index 8f92732..5864f98 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,
    int error = 1;

    mutex_lock(&bfad_mutex);
    - if (!idr_pre_get(&bfad_im_port_index, GFP_KERNEL)) {
    + error = idr_alloc(&bfad_im_port_index, im_port, 0, 0, GFP_KERNEL);
    + if (error < 0) {
    mutex_unlock(&bfad_mutex);
    - printk(KERN_WARNING "idr_pre_get failure\n");
    + printk(KERN_WARNING "idr_alloc failure\n");
    goto out;
    }
    -
    - error = idr_get_new(&bfad_im_port_index, im_port,
    - &im_port->idr_id);
    - if (error) {
    - mutex_unlock(&bfad_mutex);
    - printk(KERN_WARNING "idr_get_new failure\n");
    - goto out;
    - }
    -
    + im_port->idr_id = error;
    mutex_unlock(&bfad_mutex);

    im_port->shost = bfad_scsi_host_alloc(im_port, bfad);
    --
    1.8.1


    \
     
     \ /
      Last update: 2013-02-06 21:46    [W:4.144 / U:0.024 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site