summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2026-07-03 22:57:28 -0700
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2026-10-14 10:13:38 -0700
commit779db8dab7b972f029f0f08fa4f7d60c8a8d2348 (patch)
tree35ca0167a812ee17f78f6f28ab2b921966013805 /drivers
parent2f201770cd4a3e3178c53c977aab172085f3d2d4 (diff)
Input: maplecontrol - stop polling and clear callback on close
In dc_pad_close(), pass NULL instead of dc_pad_callback to maple_getcond_callback() to both stop polling and clear the callback pointer when the input device is closed. This makes the manual clearing of mdev->callback in remove_maple_controller() redundant, as input_unregister_device() automatically closes the device if it was open. Remove the redundant assignment. Assisted-by: Antigravity:gemini-3.5-flash Link: https://patch.msgid.link/20260703-b4-maple-cleanup-v1-5-41e424964da5@gmail.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/input/joystick/maplecontrol.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/input/joystick/maplecontrol.c b/drivers/input/joystick/maplecontrol.c
index 1eb7d279965d..19ae238e6c00 100644
--- a/drivers/input/joystick/maplecontrol.c
+++ b/drivers/input/joystick/maplecontrol.c
@@ -76,8 +76,7 @@ static void dc_pad_close(struct input_dev *dev)
{
struct dc_pad *pad = dev_get_platdata(&dev->dev);
- maple_getcond_callback(pad->mdev, dc_pad_callback, 0,
- MAPLE_FUNC_CONTROLLER);
+ maple_getcond_callback(pad->mdev, NULL, 0, MAPLE_FUNC_CONTROLLER);
}
/* allow the controller to be used */
@@ -158,7 +157,6 @@ static int remove_maple_controller(struct device *dev)
struct maple_device *mdev = to_maple_dev(dev);
struct dc_pad *pad = maple_get_drvdata(mdev);
- mdev->callback = NULL;
input_unregister_device(pad->dev);
maple_set_drvdata(mdev, NULL);
kfree(pad);