Skip to content

Commit

Permalink
Input: elantech - trust firmware about trackpoint presence
Browse files Browse the repository at this point in the history
Only try to parse data as coming from trackpoint if firmware told us that
trackpoint is present.

Fixes commit caeb0d3

Reported-and-tested-by: Marcus Overhagen <marcus.overhagen@gmail.com>
Reported-and-tested-by: Anders Kaseorg <andersk@mit.edu>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
  • Loading branch information
Dmitry Torokhov committed Nov 25, 2014
1 parent bce4f9e commit d0ab547
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions drivers/input/mouse/elantech.c
Original file line number Diff line number Diff line change
Expand Up @@ -428,14 +428,6 @@ static void elantech_report_trackpoint(struct psmouse *psmouse,
int x, y;
u32 t;

if (dev_WARN_ONCE(&psmouse->ps2dev.serio->dev,
!tp_dev,
psmouse_fmt("Unexpected trackpoint message\n"))) {
if (etd->debug == 1)
elantech_packet_dump(psmouse);
return;
}

t = get_unaligned_le32(&packet[0]);

switch (t & ~7U) {
Expand Down Expand Up @@ -793,7 +785,7 @@ static int elantech_packet_check_v4(struct psmouse *psmouse)
unsigned char packet_type = packet[3] & 0x03;
bool sanity_check;

if ((packet[3] & 0x0f) == 0x06)
if (etd->tp_dev && (packet[3] & 0x0f) == 0x06)
return PACKET_TRACKPOINT;

/*
Expand Down

0 comments on commit d0ab547

Please sign in to comment.