]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
Input: alps - use standard workqueue when registering supplemental device
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Thu, 12 Mar 2026 05:39:58 +0000 (22:39 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Thu, 12 Mar 2026 18:16:29 +0000 (11:16 -0700)
Registering supplemental bare PS/2 device does not need to be ordered
relative to attempt to resynchronization done in psmouse core.

Switch to the default workqueue and use normal (non-delayed) work.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/mouse/alps.c
drivers/input/mouse/alps.h

index f3d3b6b4e02d798e75a90333ace72a367befdbac..0ee1a30b9aaf328bb3d6530555ed5733547f3b99 100644 (file)
@@ -12,6 +12,7 @@
  * tpconfig utility (by C. Scott Ananian and Bruce Kall).
  */
 
+#include "linux/workqueue.h"
 #include <linux/slab.h>
 #include <linux/input.h>
 #include <linux/input/mt.h>
@@ -1452,7 +1453,7 @@ err_free_input:
 static void alps_register_bare_ps2_mouse(struct work_struct *work)
 {
        struct alps_data *priv = container_of(work, struct alps_data,
-                                             dev3_register_work.work);
+                                             dev3_register_work);
        int error;
 
        guard(mutex)(&alps_mutex);
@@ -1485,8 +1486,7 @@ static void alps_report_bare_ps2_packet(struct psmouse *psmouse,
        } else if (unlikely(IS_ERR_OR_NULL(priv->dev3))) {
                /* Register dev3 mouse if we received PS/2 packet first time */
                if (!IS_ERR(priv->dev3))
-                       psmouse_queue_work(psmouse, &priv->dev3_register_work,
-                                          0);
+                       schedule_work(&priv->dev3_register_work);
                return;
        } else {
                dev = priv->dev3;
@@ -2975,7 +2975,7 @@ static void alps_disconnect(struct psmouse *psmouse)
 
        psmouse_reset(psmouse);
        timer_shutdown_sync(&priv->timer);
-       disable_delayed_work_sync(&priv->dev3_register_work);
+       disable_work_sync(&priv->dev3_register_work);
        if (priv->dev2)
                input_unregister_device(priv->dev2);
        if (!IS_ERR_OR_NULL(priv->dev3))
@@ -3147,8 +3147,7 @@ int alps_init(struct psmouse *psmouse)
 
        priv->psmouse = psmouse;
 
-       INIT_DELAYED_WORK(&priv->dev3_register_work,
-                         alps_register_bare_ps2_mouse);
+       INIT_WORK(&priv->dev3_register_work, alps_register_bare_ps2_mouse);
 
        psmouse->protocol_handler = alps_process_byte;
        psmouse->poll = alps_poll;
index 0a1048cf23f6abeaaf554224f0c30cce7abbf2d3..17bbf6cdba55f2d854d2451fe2e1d7943761336b 100644 (file)
@@ -257,7 +257,7 @@ struct alps_fields {
  * @dev3: Generic PS/2 mouse (can be NULL, delayed registering).
  * @phys2: Physical path for the trackstick device.
  * @phys3: Physical path for the generic PS/2 mouse.
- * @dev3_register_work: Delayed work for registering PS/2 mouse.
+ * @dev3_register_work: A work instance for registering PS/2 mouse.
  * @nibble_commands: Command mapping used for touchpad register accesses.
  * @addr_command: Command used to tell the touchpad that a register address
  *   follows.
@@ -289,7 +289,7 @@ struct alps_data {
        struct input_dev *dev3;
        char phys2[32];
        char phys3[32];
-       struct delayed_work dev3_register_work;
+       struct work_struct dev3_register_work;
 
        /* these are autodetected when the device is identified */
        const struct alps_nibble_commands *nibble_commands;