aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/misc
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2013-11-14 20:38:05 -0500
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2013-11-14 20:38:05 -0500
commit42249094f79422fbf5ed4b54eeb48ff096809b8f (patch)
tree91e6850c8c7e8cc284cf8bb6363f8662f84011f4 /drivers/input/misc
parent936816161978ca716a56c5e553c68f25972b1e3a (diff)
parent2c027b7c48a888ab173ba45babb4525e278375d9 (diff)
Merge branch 'next' into for-linus
Merge first round of changes for 3.13 merge window.
Diffstat (limited to 'drivers/input/misc')
-rw-r--r--drivers/input/misc/Kconfig4
-rw-r--r--drivers/input/misc/ad714x-spi.c1
-rw-r--r--drivers/input/misc/cobalt_btns.c2
-rw-r--r--drivers/input/misc/da9055_onkey.c2
-rw-r--r--drivers/input/misc/mma8450.c4
-rw-r--r--drivers/input/misc/mpu3050.c1
-rw-r--r--drivers/input/misc/pwm-beeper.c1
-rw-r--r--drivers/input/misc/rb532_button.c1
-rw-r--r--drivers/input/misc/rotary_encoder.c1
-rw-r--r--drivers/input/misc/sirfsoc-onkey.c2
-rw-r--r--drivers/input/misc/uinput.c26
11 files changed, 28 insertions, 17 deletions
diff --git a/drivers/input/misc/Kconfig b/drivers/input/misc/Kconfig
index aa51baaa9b1e..5f4967d01bc3 100644
--- a/drivers/input/misc/Kconfig
+++ b/drivers/input/misc/Kconfig
@@ -156,7 +156,7 @@ config INPUT_MAX8925_ONKEY
156 156
157config INPUT_MAX8997_HAPTIC 157config INPUT_MAX8997_HAPTIC
158 tristate "MAXIM MAX8997 haptic controller support" 158 tristate "MAXIM MAX8997 haptic controller support"
159 depends on HAVE_PWM && MFD_MAX8997 159 depends on PWM && HAVE_PWM && MFD_MAX8997
160 select INPUT_FF_MEMLESS 160 select INPUT_FF_MEMLESS
161 help 161 help
162 This option enables device driver support for the haptic controller 162 This option enables device driver support for the haptic controller
@@ -461,7 +461,7 @@ config INPUT_PCF8574
461 461
462config INPUT_PWM_BEEPER 462config INPUT_PWM_BEEPER
463 tristate "PWM beeper support" 463 tristate "PWM beeper support"
464 depends on HAVE_PWM || PWM 464 depends on PWM && HAVE_PWM
465 help 465 help
466 Say Y here to get support for PWM based beeper devices. 466 Say Y here to get support for PWM based beeper devices.
467 467
diff --git a/drivers/input/misc/ad714x-spi.c b/drivers/input/misc/ad714x-spi.c
index 61891486067c..3a90b710e309 100644
--- a/drivers/input/misc/ad714x-spi.c
+++ b/drivers/input/misc/ad714x-spi.c
@@ -108,7 +108,6 @@ static int ad714x_spi_remove(struct spi_device *spi)
108 struct ad714x_chip *chip = spi_get_drvdata(spi); 108 struct ad714x_chip *chip = spi_get_drvdata(spi);
109 109
110 ad714x_remove(chip); 110 ad714x_remove(chip);
111 spi_set_drvdata(spi, NULL);
112 111
113 return 0; 112 return 0;
114} 113}
diff --git a/drivers/input/misc/cobalt_btns.c b/drivers/input/misc/cobalt_btns.c
index 4f77f87847e8..b5d71d245854 100644
--- a/drivers/input/misc/cobalt_btns.c
+++ b/drivers/input/misc/cobalt_btns.c
@@ -131,7 +131,6 @@ static int cobalt_buttons_probe(struct platform_device *pdev)
131 err_free_mem: 131 err_free_mem:
132 input_free_polled_device(poll_dev); 132 input_free_polled_device(poll_dev);
133 kfree(bdev); 133 kfree(bdev);
134 dev_set_drvdata(&pdev->dev, NULL);
135 return error; 134 return error;
136} 135}
137 136
@@ -144,7 +143,6 @@ static int cobalt_buttons_remove(struct platform_device *pdev)
144 input_free_polled_device(bdev->poll_dev); 143 input_free_polled_device(bdev->poll_dev);
145 iounmap(bdev->reg); 144 iounmap(bdev->reg);
146 kfree(bdev); 145 kfree(bdev);
147 dev_set_drvdata(dev, NULL);
148 146
149 return 0; 147 return 0;
150} 148}
diff --git a/drivers/input/misc/da9055_onkey.c b/drivers/input/misc/da9055_onkey.c
index ee6ae3a00174..a0af8b2506ce 100644
--- a/drivers/input/misc/da9055_onkey.c
+++ b/drivers/input/misc/da9055_onkey.c
@@ -36,7 +36,7 @@ static void da9055_onkey_query(struct da9055_onkey *onkey)
36 } else { 36 } else {
37 key_stat &= DA9055_NOKEY_STS; 37 key_stat &= DA9055_NOKEY_STS;
38 /* 38 /*
39 * Onkey status bit is cleared when onkey button is relased. 39 * Onkey status bit is cleared when onkey button is released.
40 */ 40 */
41 if (!key_stat) { 41 if (!key_stat) {
42 input_report_key(onkey->input, KEY_POWER, 0); 42 input_report_key(onkey->input, KEY_POWER, 0);
diff --git a/drivers/input/misc/mma8450.c b/drivers/input/misc/mma8450.c
index f3309696d053..59d4dcddf6de 100644
--- a/drivers/input/misc/mma8450.c
+++ b/drivers/input/misc/mma8450.c
@@ -168,7 +168,7 @@ static void mma8450_close(struct input_polled_dev *dev)
168 * I2C init/probing/exit functions 168 * I2C init/probing/exit functions
169 */ 169 */
170static int mma8450_probe(struct i2c_client *c, 170static int mma8450_probe(struct i2c_client *c,
171 const struct i2c_device_id *id) 171 const struct i2c_device_id *id)
172{ 172{
173 struct input_polled_dev *idev; 173 struct input_polled_dev *idev;
174 struct mma8450 *m; 174 struct mma8450 *m;
@@ -204,6 +204,8 @@ static int mma8450_probe(struct i2c_client *c,
204 goto err_free_mem; 204 goto err_free_mem;
205 } 205 }
206 206
207 i2c_set_clientdata(c, m);
208
207 return 0; 209 return 0;
208 210
209err_free_mem: 211err_free_mem:
diff --git a/drivers/input/misc/mpu3050.c b/drivers/input/misc/mpu3050.c
index dce0d95943c5..6983ffbbfb94 100644
--- a/drivers/input/misc/mpu3050.c
+++ b/drivers/input/misc/mpu3050.c
@@ -383,6 +383,7 @@ static int mpu3050_probe(struct i2c_client *client,
383 383
384 pm_runtime_enable(&client->dev); 384 pm_runtime_enable(&client->dev);
385 pm_runtime_set_autosuspend_delay(&client->dev, MPU3050_AUTO_DELAY); 385 pm_runtime_set_autosuspend_delay(&client->dev, MPU3050_AUTO_DELAY);
386 i2c_set_clientdata(client, sensor);
386 387
387 return 0; 388 return 0;
388 389
diff --git a/drivers/input/misc/pwm-beeper.c b/drivers/input/misc/pwm-beeper.c
index 2ff4d1c78ab8..940566e7be13 100644
--- a/drivers/input/misc/pwm-beeper.c
+++ b/drivers/input/misc/pwm-beeper.c
@@ -16,6 +16,7 @@
16#include <linux/input.h> 16#include <linux/input.h>
17#include <linux/module.h> 17#include <linux/module.h>
18#include <linux/kernel.h> 18#include <linux/kernel.h>
19#include <linux/of.h>
19#include <linux/platform_device.h> 20#include <linux/platform_device.h>
20#include <linux/pwm.h> 21#include <linux/pwm.h>
21#include <linux/slab.h> 22#include <linux/slab.h>
diff --git a/drivers/input/misc/rb532_button.c b/drivers/input/misc/rb532_button.c
index fb4f8ac3343b..83fff38b86b3 100644
--- a/drivers/input/misc/rb532_button.c
+++ b/drivers/input/misc/rb532_button.c
@@ -87,7 +87,6 @@ static int rb532_button_remove(struct platform_device *pdev)
87 87
88 input_unregister_polled_device(poll_dev); 88 input_unregister_polled_device(poll_dev);
89 input_free_polled_device(poll_dev); 89 input_free_polled_device(poll_dev);
90 dev_set_drvdata(&pdev->dev, NULL);
91 90
92 return 0; 91 return 0;
93} 92}
diff --git a/drivers/input/misc/rotary_encoder.c b/drivers/input/misc/rotary_encoder.c
index 5b1aff825138..f920ba7ab51f 100644
--- a/drivers/input/misc/rotary_encoder.c
+++ b/drivers/input/misc/rotary_encoder.c
@@ -24,6 +24,7 @@
24#include <linux/gpio.h> 24#include <linux/gpio.h>
25#include <linux/rotary_encoder.h> 25#include <linux/rotary_encoder.h>
26#include <linux/slab.h> 26#include <linux/slab.h>
27#include <linux/of.h>
27#include <linux/of_platform.h> 28#include <linux/of_platform.h>
28#include <linux/of_gpio.h> 29#include <linux/of_gpio.h>
29 30
diff --git a/drivers/input/misc/sirfsoc-onkey.c b/drivers/input/misc/sirfsoc-onkey.c
index 0621c367049a..7b8b03e0d0be 100644
--- a/drivers/input/misc/sirfsoc-onkey.c
+++ b/drivers/input/misc/sirfsoc-onkey.c
@@ -153,7 +153,7 @@ static struct platform_driver sirfsoc_pwrc_driver = {
153 .name = "sirfsoc-pwrc", 153 .name = "sirfsoc-pwrc",
154 .owner = THIS_MODULE, 154 .owner = THIS_MODULE,
155 .pm = &sirfsoc_pwrc_pm_ops, 155 .pm = &sirfsoc_pwrc_pm_ops,
156 .of_match_table = of_match_ptr(sirfsoc_pwrc_of_match), 156 .of_match_table = sirfsoc_pwrc_of_match,
157 } 157 }
158}; 158};
159 159
diff --git a/drivers/input/misc/uinput.c b/drivers/input/misc/uinput.c
index a0a4bbaef02c..772835938a52 100644
--- a/drivers/input/misc/uinput.c
+++ b/drivers/input/misc/uinput.c
@@ -430,20 +430,30 @@ static int uinput_setup_device(struct uinput_device *udev,
430 return retval; 430 return retval;
431} 431}
432 432
433static ssize_t uinput_inject_event(struct uinput_device *udev, 433static ssize_t uinput_inject_events(struct uinput_device *udev,
434 const char __user *buffer, size_t count) 434 const char __user *buffer, size_t count)
435{ 435{
436 struct input_event ev; 436 struct input_event ev;
437 size_t bytes = 0;
437 438
438 if (count < input_event_size()) 439 if (count != 0 && count < input_event_size())
439 return -EINVAL; 440 return -EINVAL;
440 441
441 if (input_event_from_user(buffer, &ev)) 442 while (bytes + input_event_size() <= count) {
442 return -EFAULT; 443 /*
444 * Note that even if some events were fetched successfully
445 * we are still going to return EFAULT instead of partial
446 * count to let userspace know that it got it's buffers
447 * all wrong.
448 */
449 if (input_event_from_user(buffer + bytes, &ev))
450 return -EFAULT;
443 451
444 input_event(udev->dev, ev.type, ev.code, ev.value); 452 input_event(udev->dev, ev.type, ev.code, ev.value);
453 bytes += input_event_size();
454 }
445 455
446 return input_event_size(); 456 return bytes;
447} 457}
448 458
449static ssize_t uinput_write(struct file *file, const char __user *buffer, 459static ssize_t uinput_write(struct file *file, const char __user *buffer,
@@ -460,7 +470,7 @@ static ssize_t uinput_write(struct file *file, const char __user *buffer,
460 return retval; 470 return retval;
461 471
462 retval = udev->state == UIST_CREATED ? 472 retval = udev->state == UIST_CREATED ?
463 uinput_inject_event(udev, buffer, count) : 473 uinput_inject_events(udev, buffer, count) :
464 uinput_setup_device(udev, buffer, count); 474 uinput_setup_device(udev, buffer, count);
465 475
466 mutex_unlock(&udev->mutex); 476 mutex_unlock(&udev->mutex);