Merge git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c
index 1f6fcec..a4c3729 100644
--- a/drivers/input/evdev.c
+++ b/drivers/input/evdev.c
@@ -512,7 +512,7 @@
 
 				if ((_IOC_NR(cmd) & ~EV_MAX) == _IOC_NR(EVIOCGBIT(0,0))) {
 
-					long *bits;
+					unsigned long *bits;
 					int len;
 
 					switch (_IOC_NR(cmd) & EV_MAX) {
@@ -557,7 +557,7 @@
 
 				if ((_IOC_NR(cmd) & ~ABS_MAX) == _IOC_NR(EVIOCGABS(0))) {
 
-					int t = _IOC_NR(cmd) & ABS_MAX;
+					t = _IOC_NR(cmd) & ABS_MAX;
 
 					abs.value = dev->abs[t];
 					abs.minimum = dev->absmin[t];
@@ -577,7 +577,7 @@
 
 				if ((_IOC_NR(cmd) & ~ABS_MAX) == _IOC_NR(EVIOCSABS(0))) {
 
-					int t = _IOC_NR(cmd) & ABS_MAX;
+					t = _IOC_NR(cmd) & ABS_MAX;
 
 					if (copy_from_user(&abs, p, sizeof(struct input_absinfo)))
 						return -EFAULT;
diff --git a/drivers/input/ff-core.c b/drivers/input/ff-core.c
index 783b341..eebc724 100644
--- a/drivers/input/ff-core.c
+++ b/drivers/input/ff-core.c
@@ -281,7 +281,8 @@
 		break;
 
 	default:
-		ff->playback(dev, code, value);
+		if (check_effect_access(ff, code, NULL) == 0)
+			ff->playback(dev, code, value);
 		break;
 	}
 
diff --git a/drivers/input/joystick/analog.c b/drivers/input/joystick/analog.c
index 1c1afb5..bdd157c 100644
--- a/drivers/input/joystick/analog.c
+++ b/drivers/input/joystick/analog.c
@@ -53,7 +53,7 @@
 #define ANALOG_PORTS		16
 
 static char *js[ANALOG_PORTS];
-static int js_nargs;
+static unsigned int js_nargs;
 static int analog_options[ANALOG_PORTS];
 module_param_array_named(map, js, charp, &js_nargs, 0);
 MODULE_PARM_DESC(map, "Describes analog joysticks type/capabilities");
diff --git a/drivers/input/joystick/db9.c b/drivers/input/joystick/db9.c
index c27593b..86ad102 100644
--- a/drivers/input/joystick/db9.c
+++ b/drivers/input/joystick/db9.c
@@ -46,17 +46,17 @@
 
 struct db9_config {
 	int args[2];
-	int nargs;
+	unsigned int nargs;
 };
 
 #define DB9_MAX_PORTS		3
-static struct db9_config db9[DB9_MAX_PORTS] __initdata;
+static struct db9_config db9_cfg[DB9_MAX_PORTS] __initdata;
 
-module_param_array_named(dev, db9[0].args, int, &db9[0].nargs, 0);
+module_param_array_named(dev, db9_cfg[0].args, int, &db9_cfg[0].nargs, 0);
 MODULE_PARM_DESC(dev, "Describes first attached device (<parport#>,<type>)");
-module_param_array_named(dev2, db9[1].args, int, &db9[0].nargs, 0);
+module_param_array_named(dev2, db9_cfg[1].args, int, &db9_cfg[0].nargs, 0);
 MODULE_PARM_DESC(dev2, "Describes second attached device (<parport#>,<type>)");
-module_param_array_named(dev3, db9[2].args, int, &db9[2].nargs, 0);
+module_param_array_named(dev3, db9_cfg[2].args, int, &db9_cfg[2].nargs, 0);
 MODULE_PARM_DESC(dev3, "Describes third attached device (<parport#>,<type>)");
 
 #define DB9_ARG_PARPORT		0
@@ -680,17 +680,17 @@
 	int err = 0;
 
 	for (i = 0; i < DB9_MAX_PORTS; i++) {
-		if (db9[i].nargs == 0 || db9[i].args[DB9_ARG_PARPORT] < 0)
+		if (db9_cfg[i].nargs == 0 || db9_cfg[i].args[DB9_ARG_PARPORT] < 0)
 			continue;
 
-		if (db9[i].nargs < 2) {
+		if (db9_cfg[i].nargs < 2) {
 			printk(KERN_ERR "db9.c: Device type must be specified.\n");
 			err = -EINVAL;
 			break;
 		}
 
-		db9_base[i] = db9_probe(db9[i].args[DB9_ARG_PARPORT],
-					db9[i].args[DB9_ARG_MODE]);
+		db9_base[i] = db9_probe(db9_cfg[i].args[DB9_ARG_PARPORT],
+					db9_cfg[i].args[DB9_ARG_MODE]);
 		if (IS_ERR(db9_base[i])) {
 			err = PTR_ERR(db9_base[i]);
 			break;
diff --git a/drivers/input/joystick/gamecon.c b/drivers/input/joystick/gamecon.c
index c71b58f..1a452e0 100644
--- a/drivers/input/joystick/gamecon.c
+++ b/drivers/input/joystick/gamecon.c
@@ -48,16 +48,16 @@
 
 struct gc_config {
 	int args[GC_MAX_DEVICES + 1];
-	int nargs;
+	unsigned int nargs;
 };
 
-static struct gc_config gc[GC_MAX_PORTS] __initdata;
+static struct gc_config gc_cfg[GC_MAX_PORTS] __initdata;
 
-module_param_array_named(map, gc[0].args, int, &gc[0].nargs, 0);
+module_param_array_named(map, gc_cfg[0].args, int, &gc_cfg[0].nargs, 0);
 MODULE_PARM_DESC(map, "Describes first set of devices (<parport#>,<pad1>,<pad2>,..<pad5>)");
-module_param_array_named(map2, gc[1].args, int, &gc[1].nargs, 0);
+module_param_array_named(map2, gc_cfg[1].args, int, &gc_cfg[1].nargs, 0);
 MODULE_PARM_DESC(map2, "Describes second set of devices");
-module_param_array_named(map3, gc[2].args, int, &gc[2].nargs, 0);
+module_param_array_named(map3, gc_cfg[2].args, int, &gc_cfg[2].nargs, 0);
 MODULE_PARM_DESC(map3, "Describes third set of devices");
 
 /* see also gs_psx_delay parameter in PSX support section */
@@ -810,16 +810,17 @@
 	int err = 0;
 
 	for (i = 0; i < GC_MAX_PORTS; i++) {
-		if (gc[i].nargs == 0 || gc[i].args[0] < 0)
+		if (gc_cfg[i].nargs == 0 || gc_cfg[i].args[0] < 0)
 			continue;
 
-		if (gc[i].nargs < 2) {
+		if (gc_cfg[i].nargs < 2) {
 			printk(KERN_ERR "gamecon.c: at least one device must be specified\n");
 			err = -EINVAL;
 			break;
 		}
 
-		gc_base[i] = gc_probe(gc[i].args[0], gc[i].args + 1, gc[i].nargs - 1);
+		gc_base[i] = gc_probe(gc_cfg[i].args[0],
+				      gc_cfg[i].args + 1, gc_cfg[i].nargs - 1);
 		if (IS_ERR(gc_base[i])) {
 			err = PTR_ERR(gc_base[i]);
 			break;
diff --git a/drivers/input/joystick/iforce/iforce.h b/drivers/input/joystick/iforce/iforce.h
index dadcf4f..40a853a 100644
--- a/drivers/input/joystick/iforce/iforce.h
+++ b/drivers/input/joystick/iforce/iforce.h
@@ -124,7 +124,7 @@
 	/* Buffer used for asynchronous sending of bytes to the device */
 	struct circ_buf xmit;
 	unsigned char xmit_data[XMIT_SIZE];
-	long xmit_flags[1];
+	unsigned long xmit_flags[1];
 
 					/* Force Feedback */
 	wait_queue_head_t wait;
diff --git a/drivers/input/joystick/turbografx.c b/drivers/input/joystick/turbografx.c
index 0f2c608..8381c6f 100644
--- a/drivers/input/joystick/turbografx.c
+++ b/drivers/input/joystick/turbografx.c
@@ -48,16 +48,16 @@
 
 struct tgfx_config {
 	int args[TGFX_MAX_DEVICES + 1];
-	int nargs;
+	unsigned int nargs;
 };
 
-static struct tgfx_config tgfx[TGFX_MAX_PORTS] __initdata;
+static struct tgfx_config tgfx_cfg[TGFX_MAX_PORTS] __initdata;
 
-module_param_array_named(map, tgfx[0].args, int, &tgfx[0].nargs, 0);
+module_param_array_named(map, tgfx_cfg[0].args, int, &tgfx_cfg[0].nargs, 0);
 MODULE_PARM_DESC(map, "Describes first set of devices (<parport#>,<js1>,<js2>,..<js7>");
-module_param_array_named(map2, tgfx[1].args, int, &tgfx[1].nargs, 0);
+module_param_array_named(map2, tgfx_cfg[1].args, int, &tgfx_cfg[1].nargs, 0);
 MODULE_PARM_DESC(map2, "Describes second set of devices");
-module_param_array_named(map3, tgfx[2].args, int, &tgfx[2].nargs, 0);
+module_param_array_named(map3, tgfx_cfg[2].args, int, &tgfx_cfg[2].nargs, 0);
 MODULE_PARM_DESC(map3, "Describes third set of devices");
 
 #define TGFX_REFRESH_TIME	HZ/100	/* 10 ms */
@@ -283,16 +283,18 @@
 	int err = 0;
 
 	for (i = 0; i < TGFX_MAX_PORTS; i++) {
-		if (tgfx[i].nargs == 0 || tgfx[i].args[0] < 0)
+		if (tgfx_cfg[i].nargs == 0 || tgfx_cfg[i].args[0] < 0)
 			continue;
 
-		if (tgfx[i].nargs < 2) {
+		if (tgfx_cfg[i].nargs < 2) {
 			printk(KERN_ERR "turbografx.c: at least one joystick must be specified\n");
 			err = -EINVAL;
 			break;
 		}
 
-		tgfx_base[i] = tgfx_probe(tgfx[i].args[0], tgfx[i].args + 1, tgfx[i].nargs - 1);
+		tgfx_base[i] = tgfx_probe(tgfx_cfg[i].args[0],
+					  tgfx_cfg[i].args + 1,
+					  tgfx_cfg[i].nargs - 1);
 		if (IS_ERR(tgfx_base[i])) {
 			err = PTR_ERR(tgfx_base[i]);
 			break;
diff --git a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfig
index 9f42e4d..bd707b8 100644
--- a/drivers/input/keyboard/Kconfig
+++ b/drivers/input/keyboard/Kconfig
@@ -226,6 +226,7 @@
 config KEYBOARD_AAED2000
 	tristate "AAED-2000 keyboard"
 	depends on MACH_AAED2000
+	select INPUT_POLLDEV
 	default y
 	help
 	  Say Y here to enable the keyboard on the Agilent AAED-2000
diff --git a/drivers/input/keyboard/aaed2000_kbd.c b/drivers/input/keyboard/aaed2000_kbd.c
index 3a37505..63d6ead 100644
--- a/drivers/input/keyboard/aaed2000_kbd.c
+++ b/drivers/input/keyboard/aaed2000_kbd.c
@@ -14,12 +14,11 @@
 #include <linux/delay.h>
 #include <linux/platform_device.h>
 #include <linux/init.h>
-#include <linux/input.h>
+#include <linux/input-polldev.h>
 #include <linux/interrupt.h>
 #include <linux/jiffies.h>
 #include <linux/module.h>
 #include <linux/slab.h>
-#include <linux/workqueue.h>
 
 #include <asm/arch/hardware.h>
 #include <asm/arch/aaed2000.h>
@@ -46,8 +45,7 @@
 
 struct aaedkbd {
 	unsigned char keycode[ARRAY_SIZE(aaedkbd_keycode)];
-	struct input_dev *input;
-	struct work_struct workq;
+	struct input_polled_dev *poll_dev;
 	int kbdscan_state[KB_COLS];
 	int kbdscan_count[KB_COLS];
 };
@@ -64,14 +62,15 @@
 		scancode = SCANCODE(row, col);
 		pressed = rowd & KB_ROWMASK(row);
 
-		input_report_key(aaedkbd->input, aaedkbd->keycode[scancode], pressed);
+		input_report_key(aaedkbd->poll_dev->input,
+				 aaedkbd->keycode[scancode], pressed);
 	}
 }
 
 /* Scan the hardware keyboard and push any changes up through the input layer */
-static void aaedkbd_work(void *data)
+static void aaedkbd_poll(struct input_polled_dev *dev)
 {
-	struct aaedkbd *aaedkbd = data;
+	struct aaedkbd *aaedkbd = dev->private;
 	unsigned int col, rowd;
 
 	col = 0;
@@ -90,51 +89,34 @@
 	} while (col < KB_COLS);
 
 	AAEC_GPIO_KSCAN = 0x07;
-	input_sync(aaedkbd->input);
-
-	schedule_delayed_work(&aaedkbd->workq, msecs_to_jiffies(SCAN_INTERVAL));
-}
-
-static int aaedkbd_open(struct input_dev *indev)
-{
-	struct aaedkbd *aaedkbd = input_get_drvdata(indev);
-
-	schedule_delayed_work(&aaedkbd->workq, msecs_to_jiffies(SCAN_INTERVAL));
-
-	return 0;
-}
-
-static void aaedkbd_close(struct input_dev *indev)
-{
-	struct aaedkbd *aaedkbd = input_get_drvdata(indev);
-
-	cancel_delayed_work(&aaedkbd->workq);
-	flush_scheduled_work();
+	input_sync(dev->input);
 }
 
 static int __devinit aaedkbd_probe(struct platform_device *pdev)
 {
 	struct aaedkbd *aaedkbd;
+	struct input_polled_dev *poll_dev;
 	struct input_dev *input_dev;
 	int i;
 	int error;
 
 	aaedkbd = kzalloc(sizeof(struct aaedkbd), GFP_KERNEL);
-	input_dev = input_allocate_device();
-	if (!aaedkbd || !input_dev) {
+	poll_dev = input_allocate_polled_device();
+	if (!aaedkbd || !poll_dev) {
 		error = -ENOMEM;
 		goto fail;
 	}
 
 	platform_set_drvdata(pdev, aaedkbd);
 
-	aaedkbd->input = input_dev;
-
-	/* Init keyboard rescan workqueue */
-	INIT_WORK(&aaedkbd->workq, aaedkbd_work, aaedkbd);
-
+	aaedkbd->poll_dev = poll_dev;
 	memcpy(aaedkbd->keycode, aaedkbd_keycode, sizeof(aaedkbd->keycode));
 
+	poll_dev->private = aaedkbd;
+	poll_dev->poll = aaedkbd_poll;
+	poll_dev->poll_interval = SCAN_INTERVAL;
+
+	input_dev = poll_dev->input;
 	input_dev->name = "AAED-2000 Keyboard";
 	input_dev->phys = "aaedkbd/input0";
 	input_dev->id.bustype = BUS_HOST;
@@ -143,8 +125,6 @@
 	input_dev->id.version = 0x0100;
 	input_dev->dev.parent = &pdev->dev;
 
-	input_set_drvdata(input_dev, aaedkbd);
-
 	input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP);
 	input_dev->keycode = aaedkbd->keycode;
 	input_dev->keycodesize = sizeof(unsigned char);
@@ -154,17 +134,14 @@
 		set_bit(aaedkbd->keycode[i], input_dev->keybit);
 	clear_bit(0, input_dev->keybit);
 
-	input_dev->open = aaedkbd_open;
-	input_dev->close = aaedkbd_close;
-
-	error = input_register_device(aaedkbd->input);
+	error = input_register_polled_device(aaedkbd->poll_dev);
 	if (error)
 		goto fail;
 
 	return 0;
 
  fail:	kfree(aaedkbd);
-	input_free_device(input_dev);
+	input_free_polled_device(poll_dev);
 	return error;
 }
 
@@ -172,7 +149,8 @@
 {
 	struct aaedkbd *aaedkbd = platform_get_drvdata(pdev);
 
-	input_unregister_device(aaedkbd->input);
+	input_unregister_polled_device(aaedkbd->poll_dev);
+	input_free_polled_device(aaedkbd->poll_dev);
 	kfree(aaedkbd);
 
 	return 0;
diff --git a/drivers/input/misc/uinput.c b/drivers/input/misc/uinput.c
index 031467e..a56ad4b 100644
--- a/drivers/input/misc/uinput.c
+++ b/drivers/input/misc/uinput.c
@@ -33,7 +33,6 @@
 #include <linux/slab.h>
 #include <linux/module.h>
 #include <linux/init.h>
-#include <linux/input.h>
 #include <linux/smp_lock.h>
 #include <linux/fs.h>
 #include <linux/miscdevice.h>
diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
index c77788b..666ad3a 100644
--- a/drivers/input/mouse/synaptics.c
+++ b/drivers/input/mouse/synaptics.c
@@ -185,7 +185,7 @@
 	int retries = 0;
 
 	while ((retries++ < 3) && psmouse_reset(psmouse))
-		printk(KERN_ERR "synaptics reset failed\n");
+		/* empty */;
 
 	if (synaptics_identify(psmouse))
 		return -1;
diff --git a/drivers/usb/input/acecad.c b/drivers/usb/input/acecad.c
index be8e924..dd231045 100644
--- a/drivers/usb/input/acecad.c
+++ b/drivers/usb/input/acecad.c
@@ -54,7 +54,7 @@
 	struct input_dev *input;
 	struct urb *irq;
 
-	signed char *data;
+	unsigned char *data;
 	dma_addr_t data_dma;
 };
 
diff --git a/drivers/usb/input/ati_remote2.c b/drivers/usb/input/ati_remote2.c
index a9032aa..1031543 100644
--- a/drivers/usb/input/ati_remote2.c
+++ b/drivers/usb/input/ati_remote2.c
@@ -405,9 +405,7 @@
 
 	for (i = 0; i < 2; i++) {
 		usb_free_urb(ar2->urb[i]);
-
-		if (ar2->buf[i])
-			usb_buffer_free(ar2->udev, 4, ar2->buf[i], ar2->buf_dma[i]);
+		usb_buffer_free(ar2->udev, 4, ar2->buf[i], ar2->buf_dma[i]);
 	}
 }
 
diff --git a/drivers/usb/input/kbtab.c b/drivers/usb/input/kbtab.c
index c4781b9..91e6d00 100644
--- a/drivers/usb/input/kbtab.c
+++ b/drivers/usb/input/kbtab.c
@@ -29,7 +29,7 @@
 MODULE_PARM_DESC(kb_pressure_click, "pressure threshold for clicks");
 
 struct kbtab {
-	signed char *data;
+	unsigned char *data;
 	dma_addr_t data_dma;
 	struct input_dev *dev;
 	struct usb_device *usbdev;
diff --git a/drivers/usb/input/powermate.c b/drivers/usb/input/powermate.c
index 4f93a76..448a470 100644
--- a/drivers/usb/input/powermate.c
+++ b/drivers/usb/input/powermate.c
@@ -291,12 +291,10 @@
 
 static void powermate_free_buffers(struct usb_device *udev, struct powermate_device *pm)
 {
-	if (pm->data)
-		usb_buffer_free(udev, POWERMATE_PAYLOAD_SIZE_MAX,
-				pm->data, pm->data_dma);
-	if (pm->configcr)
-		usb_buffer_free(udev, sizeof(*(pm->configcr)),
-				pm->configcr, pm->configcr_dma);
+	usb_buffer_free(udev, POWERMATE_PAYLOAD_SIZE_MAX,
+			pm->data, pm->data_dma);
+	usb_buffer_free(udev, sizeof(*(pm->configcr)),
+			pm->configcr, pm->configcr_dma);
 }
 
 /* Called whenever a USB device matching one in our supported devices table is connected */
diff --git a/drivers/usb/input/usbtouchscreen.c b/drivers/usb/input/usbtouchscreen.c
index e082941..8e18e6c 100644
--- a/drivers/usb/input/usbtouchscreen.c
+++ b/drivers/usb/input/usbtouchscreen.c
@@ -668,9 +668,8 @@
 static void usbtouch_free_buffers(struct usb_device *udev,
 				  struct usbtouch_usb *usbtouch)
 {
-	if (usbtouch->data)
-		usb_buffer_free(udev, usbtouch->type->rept_size,
-		                usbtouch->data, usbtouch->data_dma);
+	usb_buffer_free(udev, usbtouch->type->rept_size,
+	                usbtouch->data, usbtouch->data_dma);
 	kfree(usbtouch->buffer);
 }
 
diff --git a/drivers/usb/input/wacom_wac.h b/drivers/usb/input/wacom_wac.h
index a230222..8979366 100644
--- a/drivers/usb/input/wacom_wac.h
+++ b/drivers/usb/input/wacom_wac.h
@@ -39,7 +39,7 @@
 };
 
 struct wacom_wac {
-	signed char *data;
+	unsigned char *data;
         int tool[2];
         int id[2];
         __u32 serial[2];
diff --git a/drivers/usb/input/yealink.c b/drivers/usb/input/yealink.c
index c54f1a5..fc645b2 100644
--- a/drivers/usb/input/yealink.c
+++ b/drivers/usb/input/yealink.c
@@ -818,18 +818,17 @@
 		else
 			input_unregister_device(yld->idev);
 	}
-	if (yld->ctl_req)
-		usb_buffer_free(yld->udev, sizeof(*(yld->ctl_req)),
-				yld->ctl_req, yld->ctl_req_dma);
-	if (yld->ctl_data)
-		usb_buffer_free(yld->udev, USB_PKT_LEN,
-				yld->ctl_data, yld->ctl_dma);
-	if (yld->irq_data)
-		usb_buffer_free(yld->udev, USB_PKT_LEN,
-				yld->irq_data, yld->irq_dma);
 
-	usb_free_urb(yld->urb_irq);	/* parameter validation in core/urb */
-	usb_free_urb(yld->urb_ctl);	/* parameter validation in core/urb */
+	usb_free_urb(yld->urb_irq);
+	usb_free_urb(yld->urb_ctl);
+
+	usb_buffer_free(yld->udev, sizeof(*(yld->ctl_req)),
+			yld->ctl_req, yld->ctl_req_dma);
+	usb_buffer_free(yld->udev, USB_PKT_LEN,
+			yld->ctl_data, yld->ctl_dma);
+	usb_buffer_free(yld->udev, USB_PKT_LEN,
+			yld->irq_data, yld->irq_dma);
+
 	kfree(yld);
 	return err;
 }
diff --git a/include/linux/uinput.h b/include/linux/uinput.h
index 1fd61ee..a6c1e8e 100644
--- a/include/linux/uinput.h
+++ b/include/linux/uinput.h
@@ -32,6 +32,8 @@
  *		- first public version
  */
 
+#include <linux/input.h>
+
 #define UINPUT_VERSION		3
 
 #ifdef __KERNEL__