Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
authorLinus Torvalds <torvalds@woody.linux-foundation.org>
Mon, 4 Jun 2007 20:27:33 +0000 (13:27 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Mon, 4 Jun 2007 20:27:33 +0000 (13:27 -0700)
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
  Input: reduce raciness when input handlers disconnect
  Input: ucb1x00 - do not access input_dev->private directly
  Input: logips2pp - fix typo in Kconfig
  Input: db9 - do not ignore dev2 module parameter

1  2 
drivers/input/evdev.c
drivers/input/joydev.c
drivers/input/mouse/Kconfig
drivers/input/mousedev.c
drivers/input/tsdev.c
drivers/mfd/ucb1x00-ts.c

diff --combined drivers/input/evdev.c
index b234729706be800789dced2c155629e2bb448d03,93b407cd46009ed895007d60284b94c6f34caaa8..be6b93c20f606b9e477746e81688d7abe25bcdda
@@@ -18,6 -18,7 +18,6 @@@
  #include <linux/init.h>
  #include <linux/input.h>
  #include <linux/major.h>
 -#include <linux/smp_lock.h>
  #include <linux/device.h>
  #include <linux/compat.h>
  
@@@ -336,7 -337,7 +336,7 @@@ static int bits_to_user(unsigned long *
  
        if (compat) {
                len = NBITS_COMPAT(maxbit) * sizeof(compat_long_t);
 -              if (len < maxlen)
 +              if (len > maxlen)
                        len = maxlen;
  
                for (i = 0; i < len / sizeof(compat_long_t); i++)
@@@ -699,9 -700,9 +699,9 @@@ static void evdev_disconnect(struct inp
        if (evdev->open) {
                input_flush_device(handle, NULL);
                input_close_device(handle);
-               wake_up_interruptible(&evdev->wait);
                list_for_each_entry(client, &evdev->client_list, node)
                        kill_fasync(&client->fasync, SIGIO, POLL_HUP);
+               wake_up_interruptible(&evdev->wait);
        } else
                evdev_free(evdev);
  }
diff --combined drivers/input/joydev.c
index 06f0541b24daaaed730d448d7f5f68bfa2b05c40,c83bfe8914ac8ecf2b42cad17da21f656a09d2e0..10e3b7bc925fd7b68ca8e7bb418d39471caa776c
@@@ -24,6 -24,7 +24,6 @@@
  #include <linux/module.h>
  #include <linux/poll.h>
  #include <linux/init.h>
 -#include <linux/smp_lock.h>
  #include <linux/device.h>
  
  MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>");
@@@ -594,9 -595,9 +594,9 @@@ static void joydev_disconnect(struct in
  
        if (joydev->open) {
                input_close_device(handle);
-               wake_up_interruptible(&joydev->wait);
                list_for_each_entry(client, &joydev->client_list, node)
                        kill_fasync(&client->fasync, SIGIO, POLL_HUP);
+               wake_up_interruptible(&joydev->wait);
        } else
                joydev_free(joydev);
  }
index eb0167e9f0cbe66a591ba65c90dffadb5103daff,2682a7d6cb458d8880eaa88fde75ee77a7b2dac9..50e06e8dd05d764a2af87fe7aa8d5c5e6f52db94
@@@ -48,7 -48,7 +48,7 @@@ config MOUSE_PS2_ALP
          If unsure, say Y.
  
  config MOUSE_PS2_LOGIPS2PP
-       bool "Logictech PS/2++ mouse protocol extension" if EMBEDDED
+       bool "Logitech PS/2++ mouse protocol extension" if EMBEDDED
        default y
        depends on MOUSE_PS2
        help
@@@ -111,7 -111,6 +111,7 @@@ config MOUSE_SERIA
  
  config MOUSE_APPLETOUCH
        tristate "Apple USB Touchpad support"
 +      depends on USB_ARCH_HAS_HCD
        select USB
        help
          Say Y here if you want to use an Apple USB Touchpad.
diff --combined drivers/input/mousedev.c
index 8675f95093935069718d6fe8cf49d8c80ac1fbd9,dc78f62cbee16d1307aa3e0817ae9bfdac8d03cc..3f4866d8d18c85a8dae983273ba578e2e1df3d8f
@@@ -19,6 -19,7 +19,6 @@@
  #include <linux/moduleparam.h>
  #include <linux/init.h>
  #include <linux/input.h>
 -#include <linux/smp_lock.h>
  #include <linux/random.h>
  #include <linux/major.h>
  #include <linux/device.h>
@@@ -766,9 -767,9 +766,9 @@@ static void mousedev_disconnect(struct 
  
        if (mousedev->open) {
                input_close_device(handle);
-               wake_up_interruptible(&mousedev->wait);
                list_for_each_entry(client, &mousedev->client_list, node)
                        kill_fasync(&client->fasync, SIGIO, POLL_HUP);
+               wake_up_interruptible(&mousedev->wait);
        } else
                mousedev_free(mousedev);
  }
diff --combined drivers/input/tsdev.c
index 8238b13874c200f33ee5ff7534dc7264e9d81919,af4581d00d8202d4da205425c4add8bc17ec1c25..2db364898e15f434e852c304bbcb855e271de00b
@@@ -48,6 -48,7 +48,6 @@@
  #include <linux/init.h>
  #include <linux/input.h>
  #include <linux/major.h>
 -#include <linux/smp_lock.h>
  #include <linux/random.h>
  #include <linux/time.h>
  #include <linux/device.h>
@@@ -476,9 -477,9 +476,9 @@@ static void tsdev_disconnect(struct inp
  
        if (tsdev->open) {
                input_close_device(handle);
-               wake_up_interruptible(&tsdev->wait);
                list_for_each_entry(client, &tsdev->client_list, node)
                        kill_fasync(&client->fasync, SIGIO, POLL_HUP);
+               wake_up_interruptible(&tsdev->wait);
        } else
                tsdev_free(tsdev);
  }
diff --combined drivers/mfd/ucb1x00-ts.c
index 7772bd1d92b4be3af84623819e69947deb6e160c,2d03bf791cebe4abf2480ae549de7051db3a60ef..38e815a2e87135227f16095607a2a588a38d6aab
@@@ -21,6 -21,7 +21,6 @@@
  #include <linux/moduleparam.h>
  #include <linux/init.h>
  #include <linux/smp.h>
 -#include <linux/smp_lock.h>
  #include <linux/sched.h>
  #include <linux/completion.h>
  #include <linux/delay.h>
@@@ -291,7 -292,7 +291,7 @@@ static void ucb1x00_ts_irq(int idx, voi
  
  static int ucb1x00_ts_open(struct input_dev *idev)
  {
-       struct ucb1x00_ts *ts = idev->private;
+       struct ucb1x00_ts *ts = input_get_drvdata(idev);
        int ret = 0;
  
        BUG_ON(ts->rtask);
   */
  static void ucb1x00_ts_close(struct input_dev *idev)
  {
-       struct ucb1x00_ts *ts = idev->private;
+       struct ucb1x00_ts *ts = input_get_drvdata(idev);
  
        if (ts->rtask)
                kthread_stop(ts->rtask);
@@@ -380,7 -381,6 +380,6 @@@ static int ucb1x00_ts_add(struct ucb1x0
        ts->idev = idev;
        ts->adcsync = adcsync ? UCB_SYNC : UCB_NOSYNC;
  
-       idev->private    = ts;
        idev->name       = "Touchscreen panel";
        idev->id.product = ts->ucb->id;
        idev->open       = ucb1x00_ts_open;
        __set_bit(ABS_Y, idev->absbit);
        __set_bit(ABS_PRESSURE, idev->absbit);
  
+       input_set_drvdata(idev, ts);
        err = input_register_device(idev);
        if (err)
                goto fail;