Skip to content

Commit 45bf5ed

Browse files
tititiou36Jiri Kosina
authored andcommitted
HID: sony: 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 <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent 4e124ed commit 45bf5ed

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/hid/hid-sony.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1844,8 +1844,7 @@ static int sony_set_device_id(struct sony_sc *sc)
18441844
* All others are set to -1.
18451845
*/
18461846
if (sc->quirks & SIXAXIS_CONTROLLER) {
1847-
ret = ida_simple_get(&sony_device_id_allocator, 0, 0,
1848-
GFP_KERNEL);
1847+
ret = ida_alloc(&sony_device_id_allocator, GFP_KERNEL);
18491848
if (ret < 0) {
18501849
sc->device_id = -1;
18511850
return ret;
@@ -1861,7 +1860,7 @@ static int sony_set_device_id(struct sony_sc *sc)
18611860
static void sony_release_device_id(struct sony_sc *sc)
18621861
{
18631862
if (sc->device_id >= 0) {
1864-
ida_simple_remove(&sony_device_id_allocator, sc->device_id);
1863+
ida_free(&sony_device_id_allocator, sc->device_id);
18651864
sc->device_id = -1;
18661865
}
18671866
}

0 commit comments

Comments
 (0)