Commit 97a7d895 authored by Christophe JAILLET's avatar Christophe JAILLET Committed by Dmitry Torokhov

Input: xpad - remove usage of the deprecated ida_simple_xx() API

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: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/a3e30e30f18cc5d6f032c8013ce9d900c8e223e5.1702228806.git.christophe.jaillet@wanadoo.frSigned-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent 02db1749
......@@ -1665,7 +1665,7 @@ static int xpad_led_probe(struct usb_xpad *xpad)
if (!led)
return -ENOMEM;
xpad->pad_nr = ida_simple_get(&xpad_pad_seq, 0, 0, GFP_KERNEL);
xpad->pad_nr = ida_alloc(&xpad_pad_seq, GFP_KERNEL);
if (xpad->pad_nr < 0) {
error = xpad->pad_nr;
goto err_free_mem;
......@@ -1688,7 +1688,7 @@ static int xpad_led_probe(struct usb_xpad *xpad)
return 0;
err_free_id:
ida_simple_remove(&xpad_pad_seq, xpad->pad_nr);
ida_free(&xpad_pad_seq, xpad->pad_nr);
err_free_mem:
kfree(led);
xpad->led = NULL;
......@@ -1701,7 +1701,7 @@ static void xpad_led_disconnect(struct usb_xpad *xpad)
if (xpad_led) {
led_classdev_unregister(&xpad_led->led_cdev);
ida_simple_remove(&xpad_pad_seq, xpad->pad_nr);
ida_free(&xpad_pad_seq, xpad->pad_nr);
kfree(xpad_led);
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment