]> git.itanic.dy.fi Git - linux-stable/commitdiff
ipack: Remove usage of the deprecated ida_simple_xx() API
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Wed, 1 Nov 2023 09:41:17 +0000 (10:41 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 7 Dec 2023 02:09:19 +0000 (11:09 +0900)
ida_alloc() and ida_free() should be preferred to the deprecated
ida_simple_get() and ida_simple_remove().

This is less verbose.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Acked-by: Vaibhav Gupta <vaibhavgupta40@gmail.com>
Link: https://lore.kernel.org/r/435bd17b8a5ddb2fc3e42e2796117ee02263d02a.1698831664.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/ipack/ipack.c

index cc1ecfd4992866c780cc57e68583eb9e4f415713..b1471ba016a515b11abf87a5987905174f8aaf6d 100644 (file)
@@ -207,7 +207,7 @@ struct ipack_bus_device *ipack_bus_register(struct device *parent, int slots,
        if (!bus)
                return NULL;
 
-       bus_nr = ida_simple_get(&ipack_ida, 0, 0, GFP_KERNEL);
+       bus_nr = ida_alloc(&ipack_ida, GFP_KERNEL);
        if (bus_nr < 0) {
                kfree(bus);
                return NULL;
@@ -237,7 +237,7 @@ int ipack_bus_unregister(struct ipack_bus_device *bus)
 {
        bus_for_each_dev(&ipack_bus_type, NULL, bus,
                ipack_unregister_bus_member);
-       ida_simple_remove(&ipack_ida, bus->bus_nr);
+       ida_free(&ipack_ida, bus->bus_nr);
        kfree(bus);
        return 0;
 }