HID: sony: Remove usage of the deprecated ida_simple_xx() API
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sun, 14 Apr 2024 10:03:11 +0000 (12:03 +0200)
committerJiri Kosina <jkosina@suse.com>
Tue, 16 Apr 2024 07:50:37 +0000 (09:50 +0200)
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>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
drivers/hid/hid-sony.c

index 1d37b39e1171f5cc54d727d2057094d9979774e9..5a07a91a89ae13ab26149d0873c4d916deb0c014 100644 (file)
@@ -1844,8 +1844,7 @@ static int sony_set_device_id(struct sony_sc *sc)
         * All others are set to -1.
         */
        if (sc->quirks & SIXAXIS_CONTROLLER) {
-               ret = ida_simple_get(&sony_device_id_allocator, 0, 0,
-                                       GFP_KERNEL);
+               ret = ida_alloc(&sony_device_id_allocator, GFP_KERNEL);
                if (ret < 0) {
                        sc->device_id = -1;
                        return ret;
@@ -1861,7 +1860,7 @@ static int sony_set_device_id(struct sony_sc *sc)
 static void sony_release_device_id(struct sony_sc *sc)
 {
        if (sc->device_id >= 0) {
-               ida_simple_remove(&sony_device_id_allocator, sc->device_id);
+               ida_free(&sony_device_id_allocator, sc->device_id);
                sc->device_id = -1;
        }
 }