Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/a3e30e30f18cc5d6f032c8013ce9d900c8e223e5.1702228806.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

authored by

Christophe JAILLET and committed by
Dmitry Torokhov
97a7d895 02db1749

+3 -3
+3 -3
drivers/input/joystick/xpad.c
··· 1665 1665 if (!led) 1666 1666 return -ENOMEM; 1667 1667 1668 - xpad->pad_nr = ida_simple_get(&xpad_pad_seq, 0, 0, GFP_KERNEL); 1668 + xpad->pad_nr = ida_alloc(&xpad_pad_seq, GFP_KERNEL); 1669 1669 if (xpad->pad_nr < 0) { 1670 1670 error = xpad->pad_nr; 1671 1671 goto err_free_mem; ··· 1688 1688 return 0; 1689 1689 1690 1690 err_free_id: 1691 - ida_simple_remove(&xpad_pad_seq, xpad->pad_nr); 1691 + ida_free(&xpad_pad_seq, xpad->pad_nr); 1692 1692 err_free_mem: 1693 1693 kfree(led); 1694 1694 xpad->led = NULL; ··· 1701 1701 1702 1702 if (xpad_led) { 1703 1703 led_classdev_unregister(&xpad_led->led_cdev); 1704 - ida_simple_remove(&xpad_pad_seq, xpad->pad_nr); 1704 + ida_free(&xpad_pad_seq, xpad->pad_nr); 1705 1705 kfree(xpad_led); 1706 1706 } 1707 1707 }