summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2013-05-09 13:31:38 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2013-05-09 13:49:10 +1000
commit2dffd217b112c346c6c0b07e82cb069a3cf84246 (patch)
treee26eb6d78b2907eb9d3d56b01866084540ef9271
parentb350a95717ac04a0bed1d836a0b90c94724dc597 (diff)
Don't init abswheel2 valuator (7th val) if we don't have one
InitValuatorAxisStruct() will return if the axisnum > num_axes and not initialise anything which is why the current code worked without issues. With a new patch to the server this will now complain with an error message to the log. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Ping Cheng <pinglinux@gmail.com>
-rw-r--r--src/xf86Wacom.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/xf86Wacom.c b/src/xf86Wacom.c
index 5289292..6ecf036 100644
--- a/src/xf86Wacom.c
+++ b/src/xf86Wacom.c
@@ -296,20 +296,21 @@ static int wcmInitAxes(DeviceIntPtr pWcm)
/* seventh valuator: abswheel2 */
- index = 6;
- label = None;
- mode = Absolute;
- min_res = max_res = res = 1;
- min = 0;
- max = 1;
-
if ((TabletHasFeature(common, WCM_DUALRING)) && IsPad(priv))
- { /* XXX: what is this axis label? */
+ {
+ /* XXX: what is this axis label? */
+ index = 6;
+ label = None;
+ mode = Absolute;
+ min_res = max_res = res = 1;
+ min = 0;
+ max = 1;
+
min = MIN_PAD_RING;
max = MAX_PAD_RING;
- }
- wcmInitAxis(pInfo->dev, index, label, min, max, res, min_res, max_res, mode);
+ wcmInitAxis(pInfo->dev, index, label, min, max, res, min_res, max_res, mode);
+ }
return TRUE;
}