]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
Input: libps2 - remove delayed command execution
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Tue, 6 May 2008 16:11:39 +0000 (12:11 -0400)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Fri, 16 May 2008 18:50:49 +0000 (14:50 -0400)
Delayed command execution is not used by anyone so let's remove it.

Reported-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
drivers/input/serio/libps2.c
include/linux/libps2.h

index b819239d74dc15f0c7fa41fce8a8c9658b33fc1a..2b304c22c2008c41d6262acb3514b750fb862dcb 100644 (file)
@@ -26,15 +26,6 @@ MODULE_AUTHOR("Dmitry Torokhov <dtor@mail.ru>");
 MODULE_DESCRIPTION("PS/2 driver library");
 MODULE_LICENSE("GPL");
 
-/* Work structure to schedule execution of a command */
-struct ps2work {
-       struct work_struct work;
-       struct ps2dev *ps2dev;
-       int command;
-       unsigned char param[0];
-};
-
-
 /*
  * ps2_sendbyte() sends a byte to the device and waits for acknowledge.
  * It doesn't handle retransmission, though it could - because if there
@@ -245,49 +236,6 @@ int ps2_command(struct ps2dev *ps2dev, unsigned char *param, int command)
 }
 EXPORT_SYMBOL(ps2_command);
 
-/*
- * ps2_execute_scheduled_command() sends a command, previously scheduled by
- * ps2_schedule_command(), to a PS/2 device (keyboard, mouse, etc.)
- */
-
-static void ps2_execute_scheduled_command(struct work_struct *work)
-{
-       struct ps2work *ps2work = container_of(work, struct ps2work, work);
-
-       ps2_command(ps2work->ps2dev, ps2work->param, ps2work->command);
-       kfree(ps2work);
-}
-
-/*
- * ps2_schedule_command() allows to schedule delayed execution of a PS/2
- * command and can be used to issue a command from an interrupt or softirq
- * context.
- */
-
-int ps2_schedule_command(struct ps2dev *ps2dev, unsigned char *param, int command)
-{
-       struct ps2work *ps2work;
-       int send = (command >> 12) & 0xf;
-       int receive = (command >> 8) & 0xf;
-
-       if (!(ps2work = kmalloc(sizeof(struct ps2work) + max(send, receive), GFP_ATOMIC)))
-               return -1;
-
-       memset(ps2work, 0, sizeof(struct ps2work));
-       ps2work->ps2dev = ps2dev;
-       ps2work->command = command;
-       memcpy(ps2work->param, param, send);
-       INIT_WORK(&ps2work->work, ps2_execute_scheduled_command);
-
-       if (!schedule_work(&ps2work->work)) {
-               kfree(ps2work);
-               return -1;
-       }
-
-       return 0;
-}
-EXPORT_SYMBOL(ps2_schedule_command);
-
 /*
  * ps2_init() initializes ps2dev structure
  */
index f6f301e2b0f58a5f229c62c826f810c8e1177431..afc413369101998ce5010ad56b23c752c68b4870 100644 (file)
@@ -43,7 +43,6 @@ void ps2_init(struct ps2dev *ps2dev, struct serio *serio);
 int ps2_sendbyte(struct ps2dev *ps2dev, unsigned char byte, int timeout);
 void ps2_drain(struct ps2dev *ps2dev, int maxbytes, int timeout);
 int ps2_command(struct ps2dev *ps2dev, unsigned char *param, int command);
-int ps2_schedule_command(struct ps2dev *ps2dev, unsigned char *param, int command);
 int ps2_handle_ack(struct ps2dev *ps2dev, unsigned char data);
 int ps2_handle_response(struct ps2dev *ps2dev, unsigned char data);
 void ps2_cmd_aborted(struct ps2dev *ps2dev);