diff options
author | Hans de Goede <hdegoede@redhat.com> | 2014-07-26 01:48:44 -0400 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2014-07-26 17:03:18 -0400 |
commit | 38c11eaaab0cf8ef6004aa704f1bb2ff5e6bc1b0 (patch) | |
tree | 81feab2bc1b813d6042d71632299a416dffabb5b | |
parent | 99d9996c5c3b47c14c8717c7dd4692a25b83b3f7 (diff) |
Input: alps - change decode function prototype to return an int
So that decode functions can return a failure when appropriate.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-rw-r--r-- | drivers/input/mouse/alps.c | 12 | ||||
-rw-r--r-- | drivers/input/mouse/alps.h | 2 |
2 files changed, 10 insertions, 4 deletions
diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c index 5026600278d3..8f794913f4cd 100644 --- a/drivers/input/mouse/alps.c +++ b/drivers/input/mouse/alps.c | |||
@@ -538,7 +538,7 @@ static void alps_decode_buttons_v3(struct alps_fields *f, unsigned char *p) | |||
538 | f->ts_middle = !!(p[3] & 0x40); | 538 | f->ts_middle = !!(p[3] & 0x40); |
539 | } | 539 | } |
540 | 540 | ||
541 | static void alps_decode_pinnacle(struct alps_fields *f, unsigned char *p, | 541 | static int alps_decode_pinnacle(struct alps_fields *f, unsigned char *p, |
542 | struct psmouse *psmouse) | 542 | struct psmouse *psmouse) |
543 | { | 543 | { |
544 | f->first_mp = !!(p[4] & 0x40); | 544 | f->first_mp = !!(p[4] & 0x40); |
@@ -558,9 +558,11 @@ static void alps_decode_pinnacle(struct alps_fields *f, unsigned char *p, | |||
558 | f->pressure = p[5] & 0x7f; | 558 | f->pressure = p[5] & 0x7f; |
559 | 559 | ||
560 | alps_decode_buttons_v3(f, p); | 560 | alps_decode_buttons_v3(f, p); |
561 | |||
562 | return 0; | ||
561 | } | 563 | } |
562 | 564 | ||
563 | static void alps_decode_rushmore(struct alps_fields *f, unsigned char *p, | 565 | static int alps_decode_rushmore(struct alps_fields *f, unsigned char *p, |
564 | struct psmouse *psmouse) | 566 | struct psmouse *psmouse) |
565 | { | 567 | { |
566 | alps_decode_pinnacle(f, p, psmouse); | 568 | alps_decode_pinnacle(f, p, psmouse); |
@@ -570,9 +572,11 @@ static void alps_decode_rushmore(struct alps_fields *f, unsigned char *p, | |||
570 | f->fingers = max((p[5] & 0x3), ((p[5] >> 2) & 0x3)) + 1; | 572 | f->fingers = max((p[5] & 0x3), ((p[5] >> 2) & 0x3)) + 1; |
571 | f->x_map |= (p[5] & 0x10) << 11; | 573 | f->x_map |= (p[5] & 0x10) << 11; |
572 | f->y_map |= (p[5] & 0x20) << 6; | 574 | f->y_map |= (p[5] & 0x20) << 6; |
575 | |||
576 | return 0; | ||
573 | } | 577 | } |
574 | 578 | ||
575 | static void alps_decode_dolphin(struct alps_fields *f, unsigned char *p, | 579 | static int alps_decode_dolphin(struct alps_fields *f, unsigned char *p, |
576 | struct psmouse *psmouse) | 580 | struct psmouse *psmouse) |
577 | { | 581 | { |
578 | u64 palm_data = 0; | 582 | u64 palm_data = 0; |
@@ -605,6 +609,8 @@ static void alps_decode_dolphin(struct alps_fields *f, unsigned char *p, | |||
605 | f->x_map = (palm_data >> priv->y_bits) & | 609 | f->x_map = (palm_data >> priv->y_bits) & |
606 | (BIT(priv->x_bits) - 1); | 610 | (BIT(priv->x_bits) - 1); |
607 | } | 611 | } |
612 | |||
613 | return 0; | ||
608 | } | 614 | } |
609 | 615 | ||
610 | static void alps_process_touchpad_packet_v3_v5(struct psmouse *psmouse) | 616 | static void alps_process_touchpad_packet_v3_v5(struct psmouse *psmouse) |
diff --git a/drivers/input/mouse/alps.h b/drivers/input/mouse/alps.h index ee841e53ef9c..17e3ae39bcb7 100644 --- a/drivers/input/mouse/alps.h +++ b/drivers/input/mouse/alps.h | |||
@@ -157,7 +157,7 @@ struct alps_data { | |||
157 | 157 | ||
158 | int (*hw_init)(struct psmouse *psmouse); | 158 | int (*hw_init)(struct psmouse *psmouse); |
159 | void (*process_packet)(struct psmouse *psmouse); | 159 | void (*process_packet)(struct psmouse *psmouse); |
160 | void (*decode_fields)(struct alps_fields *f, unsigned char *p, | 160 | int (*decode_fields)(struct alps_fields *f, unsigned char *p, |
161 | struct psmouse *psmouse); | 161 | struct psmouse *psmouse); |
162 | void (*set_abs_params)(struct alps_data *priv, struct input_dev *dev1); | 162 | void (*set_abs_params)(struct alps_data *priv, struct input_dev *dev1); |
163 | 163 | ||