aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-02-18 13:23:40 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-02-18 13:23:40 -0500
commite9cf59aeeea49ae84ffcf0e28699b46d705e85f0 (patch)
tree7aae7ea622b3bc71953aeee9ca302660e95a4f51
parent7c45512df987c5619db041b5c9b80d281e26d3db (diff)
parent9937c026820baabd1e908a9c1e6bdc846293000a (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
Pull input subsystem fixes from Dmitry Torokhov: "Two small driver fixups and a documentation update for managed input devices" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: Input: wacom - fix wacom_set_report retry logic Input: document that unregistering managed devices is not necessary Input: lm8323 - fix checking PWM interrupt status
-rw-r--r--drivers/input/input.c16
-rw-r--r--drivers/input/keyboard/lm8323.c2
-rw-r--r--drivers/input/tablet/wacom_sys.c6
3 files changed, 18 insertions, 6 deletions
diff --git a/drivers/input/input.c b/drivers/input/input.c
index ce01332f7b3a..c04469928925 100644
--- a/drivers/input/input.c
+++ b/drivers/input/input.c
@@ -1785,12 +1785,13 @@ static void devm_input_device_release(struct device *dev, void *res)
1785 * its driver (or binding fails). Once managed input device is allocated, 1785 * its driver (or binding fails). Once managed input device is allocated,
1786 * it is ready to be set up and registered in the same fashion as regular 1786 * it is ready to be set up and registered in the same fashion as regular
1787 * input device. There are no special devm_input_device_[un]register() 1787 * input device. There are no special devm_input_device_[un]register()
1788 * variants, regular ones work with both managed and unmanaged devices. 1788 * variants, regular ones work with both managed and unmanaged devices,
1789 * should you need them. In most cases however, managed input device need
1790 * not be explicitly unregistered or freed.
1789 * 1791 *
1790 * NOTE: the owner device is set up as parent of input device and users 1792 * NOTE: the owner device is set up as parent of input device and users
1791 * should not override it. 1793 * should not override it.
1792 */ 1794 */
1793
1794struct input_dev *devm_input_allocate_device(struct device *dev) 1795struct input_dev *devm_input_allocate_device(struct device *dev)
1795{ 1796{
1796 struct input_dev *input; 1797 struct input_dev *input;
@@ -2004,6 +2005,17 @@ static void devm_input_device_unregister(struct device *dev, void *res)
2004 * Once device has been successfully registered it can be unregistered 2005 * Once device has been successfully registered it can be unregistered
2005 * with input_unregister_device(); input_free_device() should not be 2006 * with input_unregister_device(); input_free_device() should not be
2006 * called in this case. 2007 * called in this case.
2008 *
2009 * Note that this function is also used to register managed input devices
2010 * (ones allocated with devm_input_allocate_device()). Such managed input
2011 * devices need not be explicitly unregistered or freed, their tear down
2012 * is controlled by the devres infrastructure. It is also worth noting
2013 * that tear down of managed input devices is internally a 2-step process:
2014 * registered managed input device is first unregistered, but stays in
2015 * memory and can still handle input_event() calls (although events will
2016 * not be delivered anywhere). The freeing of managed input device will
2017 * happen later, when devres stack is unwound to the point where device
2018 * allocation was made.
2007 */ 2019 */
2008int input_register_device(struct input_dev *dev) 2020int input_register_device(struct input_dev *dev)
2009{ 2021{
diff --git a/drivers/input/keyboard/lm8323.c b/drivers/input/keyboard/lm8323.c
index 93c812662134..0de23f41b2d3 100644
--- a/drivers/input/keyboard/lm8323.c
+++ b/drivers/input/keyboard/lm8323.c
@@ -398,7 +398,7 @@ static irqreturn_t lm8323_irq(int irq, void *_lm)
398 lm8323_configure(lm); 398 lm8323_configure(lm);
399 } 399 }
400 for (i = 0; i < LM8323_NUM_PWMS; i++) { 400 for (i = 0; i < LM8323_NUM_PWMS; i++) {
401 if (ints & (1 << (INT_PWM1 + i))) { 401 if (ints & (INT_PWM1 << i)) {
402 dev_vdbg(&lm->client->dev, 402 dev_vdbg(&lm->client->dev,
403 "pwm%d engine completed\n", i); 403 "pwm%d engine completed\n", i);
404 pwm_done(&lm->pwm[i]); 404 pwm_done(&lm->pwm[i]);
diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c
index f92d34f45a1c..aaf23aeae2ea 100644
--- a/drivers/input/tablet/wacom_sys.c
+++ b/drivers/input/tablet/wacom_sys.c
@@ -553,10 +553,10 @@ static int wacom_set_device_mode(struct usb_interface *intf, int report_id, int
553 if (!rep_data) 553 if (!rep_data)
554 return error; 554 return error;
555 555
556 rep_data[0] = report_id;
557 rep_data[1] = mode;
558
559 do { 556 do {
557 rep_data[0] = report_id;
558 rep_data[1] = mode;
559
560 error = wacom_set_report(intf, WAC_HID_FEATURE_REPORT, 560 error = wacom_set_report(intf, WAC_HID_FEATURE_REPORT,
561 report_id, rep_data, length, 1); 561 report_id, rep_data, length, 1);
562 if (error >= 0) 562 if (error >= 0)