Input: xpad - handle "present" and "gone" correctly
authorPierre-Loup A. Griffais <pgriffais@valvesoftware.com>
Wed, 9 Dec 2015 19:46:25 +0000 (11:46 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 1 Dec 2018 08:48:01 +0000 (09:48 +0100)
commit7a0a65d1576e022b9959ffd25ed8c1f7bd2ccee0
treed5ff32f5262679fb1d54236dd06c629bffb80f94
parenta03c1ce2b727c73b81e3a0fca3d43f065ff49256
Input: xpad - handle "present" and "gone" correctly

[ Upstream commit 09c8b00ae3e16c8d0fd4beb2ca064502a76c0f17 ]

Handle the "a new device is present" message properly by dynamically
creating the input device at this point in time. This means we now do not
"preallocate" all 4 devices when a single wireless base station is seen.
This requires a workqueue as we are in interrupt context when we learn
about this.

Also properly disconnect any devices that we are told are removed.

Signed-off-by: "Pierre-Loup A. Griffais" <pgriffais@valvesoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Pavel Rojtberg <rojtberg@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/input/joystick/xpad.c