diff options
Diffstat (limited to 'drivers/input/mousedev.c')
-rw-r--r-- | drivers/input/mousedev.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/input/mousedev.c b/drivers/input/mousedev.c index 2d0af44ac4b9..81fd7a97a93d 100644 --- a/drivers/input/mousedev.c +++ b/drivers/input/mousedev.c | |||
@@ -40,15 +40,15 @@ MODULE_LICENSE("GPL"); | |||
40 | #endif | 40 | #endif |
41 | 41 | ||
42 | static int xres = CONFIG_INPUT_MOUSEDEV_SCREEN_X; | 42 | static int xres = CONFIG_INPUT_MOUSEDEV_SCREEN_X; |
43 | module_param(xres, uint, 0); | 43 | module_param(xres, uint, 0644); |
44 | MODULE_PARM_DESC(xres, "Horizontal screen resolution"); | 44 | MODULE_PARM_DESC(xres, "Horizontal screen resolution"); |
45 | 45 | ||
46 | static int yres = CONFIG_INPUT_MOUSEDEV_SCREEN_Y; | 46 | static int yres = CONFIG_INPUT_MOUSEDEV_SCREEN_Y; |
47 | module_param(yres, uint, 0); | 47 | module_param(yres, uint, 0644); |
48 | MODULE_PARM_DESC(yres, "Vertical screen resolution"); | 48 | MODULE_PARM_DESC(yres, "Vertical screen resolution"); |
49 | 49 | ||
50 | static unsigned tap_time = 200; | 50 | static unsigned tap_time = 200; |
51 | module_param(tap_time, uint, 0); | 51 | module_param(tap_time, uint, 0644); |
52 | MODULE_PARM_DESC(tap_time, "Tap time for touchpads in absolute mode (msecs)"); | 52 | MODULE_PARM_DESC(tap_time, "Tap time for touchpads in absolute mode (msecs)"); |
53 | 53 | ||
54 | struct mousedev_hw_data { | 54 | struct mousedev_hw_data { |
@@ -155,7 +155,7 @@ static void mousedev_abs_event(struct input_dev *dev, struct mousedev *mousedev, | |||
155 | switch (code) { | 155 | switch (code) { |
156 | case ABS_X: | 156 | case ABS_X: |
157 | size = dev->absmax[ABS_X] - dev->absmin[ABS_X]; | 157 | size = dev->absmax[ABS_X] - dev->absmin[ABS_X]; |
158 | if (size == 0) size = xres; | 158 | if (size == 0) size = xres ? : 1; |
159 | if (value > dev->absmax[ABS_X]) value = dev->absmax[ABS_X]; | 159 | if (value > dev->absmax[ABS_X]) value = dev->absmax[ABS_X]; |
160 | if (value < dev->absmin[ABS_X]) value = dev->absmin[ABS_X]; | 160 | if (value < dev->absmin[ABS_X]) value = dev->absmin[ABS_X]; |
161 | mousedev->packet.x = ((value - dev->absmin[ABS_X]) * xres) / size; | 161 | mousedev->packet.x = ((value - dev->absmin[ABS_X]) * xres) / size; |
@@ -164,7 +164,7 @@ static void mousedev_abs_event(struct input_dev *dev, struct mousedev *mousedev, | |||
164 | 164 | ||
165 | case ABS_Y: | 165 | case ABS_Y: |
166 | size = dev->absmax[ABS_Y] - dev->absmin[ABS_Y]; | 166 | size = dev->absmax[ABS_Y] - dev->absmin[ABS_Y]; |
167 | if (size == 0) size = yres; | 167 | if (size == 0) size = yres ? : 1; |
168 | if (value > dev->absmax[ABS_Y]) value = dev->absmax[ABS_Y]; | 168 | if (value > dev->absmax[ABS_Y]) value = dev->absmax[ABS_Y]; |
169 | if (value < dev->absmin[ABS_Y]) value = dev->absmin[ABS_Y]; | 169 | if (value < dev->absmin[ABS_Y]) value = dev->absmin[ABS_Y]; |
170 | mousedev->packet.y = yres - ((value - dev->absmin[ABS_Y]) * yres) / size; | 170 | mousedev->packet.y = yres - ((value - dev->absmin[ABS_Y]) * yres) / size; |