HID: nintendo: use ida for LED player id
authorMartino Fontana <tinozzo123@gmail.com>
Mon, 18 Mar 2024 10:36:28 +0000 (11:36 +0100)
committerJiri Kosina <jkosina@suse.com>
Wed, 3 Apr 2024 11:26:14 +0000 (13:26 +0200)
commit5307de63d71d0b2303a8c645493a36021bedd800
tree649fb25826a01abf734d59e8c33a1cbbcb802ce6
parent3e78a6c0d3e02e4cf881dc84c5127e9990f939d6
HID: nintendo: use ida for LED player id

Previously, the leds pattern would just increment with every controller
connected. This wouldn't take into consideration when controllers are
disconnected. The same controller could be connected and disconnected
with the pattern increasing player count each time.

This patch changes it by using an ID allocator in order to assign the
player id, the same way hid-playstation does.

Signed-off-by: Martino Fontana <tinozzo123@gmail.com>
Signed-off-by: Ryan McClelland <rymcclel@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
drivers/hid/hid-nintendo.c