aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/input.c
diff options
context:
space:
mode:
authorAnssi Hannula <anssi.hannula@gmail.com>2006-07-19 01:40:22 -0400
committerDmitry Torokhov <dtor@insightbb.com>2006-07-19 01:40:22 -0400
commit509ca1a9383601fdc5612d3d3ba5b981f6eb6c8b (patch)
tree4d7b63c2b108510c11a89dc0ea45efe788fed779 /drivers/input/input.c
parent806d41b756fecc1b13584e2b806b76d8934b1679 (diff)
Input: implement new force feedback interface
Implement a new force feedback interface, in which all non-driver-specific operations are separated to a common module. This includes handling effect type validations, locking, etc. The effects are now file descriptor specific instead of the previous strange half-process half-fd specific behaviour. The effect memory of devices is not emptied if the root user opens and closes the device while another user is using effects. This is a minor change and most likely no force feedback aware programs are affected by this negatively. Otherwise the userspace interface is left unaltered. Signed-off-by: Anssi Hannula <anssi.hannula@gmail.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/input.c')
-rw-r--r--drivers/input/input.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/input/input.c b/drivers/input/input.c
index 9cb4b9a54f01..1fc0517e9428 100644
--- a/drivers/input/input.c
+++ b/drivers/input/input.c
@@ -176,6 +176,10 @@ void input_event(struct input_dev *dev, unsigned int type, unsigned int code, in
176 break; 176 break;
177 177
178 case EV_FF: 178 case EV_FF:
179
180 if (value < 0)
181 return;
182
179 if (dev->event) 183 if (dev->event)
180 dev->event(dev, type, code, value); 184 dev->event(dev, type, code, value);
181 break; 185 break;
@@ -762,7 +766,9 @@ static void input_dev_release(struct class_device *class_dev)
762{ 766{
763 struct input_dev *dev = to_input_dev(class_dev); 767 struct input_dev *dev = to_input_dev(class_dev);
764 768
769 input_ff_destroy(dev);
765 kfree(dev); 770 kfree(dev);
771
766 module_put(THIS_MODULE); 772 module_put(THIS_MODULE);
767} 773}
768 774