]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net: nfc: Directly use ida_alloc()/free()
authorkeliu <liuke94@huawei.com>
Fri, 27 May 2022 06:42:25 +0000 (06:42 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sat, 28 May 2022 14:28:47 +0000 (15:28 +0100)
Use ida_alloc()/ida_free() instead of deprecated
ida_simple_get()/ida_simple_remove() .

Signed-off-by: keliu <liuke94@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/nfc/core.c

index 6ff3e10ff8e3521fd86d6e5cc555daa3ff2df87a..eb2c0959e5b6a56a0702adc598136b2426a87fa3 100644 (file)
@@ -975,7 +975,7 @@ static void nfc_release(struct device *d)
                        kfree(se);
        }
 
-       ida_simple_remove(&nfc_index_ida, dev->idx);
+       ida_free(&nfc_index_ida, dev->idx);
 
        kfree(dev);
 }
@@ -1066,7 +1066,7 @@ struct nfc_dev *nfc_allocate_device(const struct nfc_ops *ops,
        if (!dev)
                return NULL;
 
-       rc = ida_simple_get(&nfc_index_ida, 0, 0, GFP_KERNEL);
+       rc = ida_alloc(&nfc_index_ida, GFP_KERNEL);
        if (rc < 0)
                goto err_free_dev;
        dev->idx = rc;