Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
fork

Configure Feed

Select the types of activity you want to include in your feed.

Input: synaptics - add a matches_pnp_id helper function

This is a preparation patch for simplifying the min/max quirk table.

Cc: stable@vger.kernel.org
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

authored by

Hans de Goede and committed by
Dmitry Torokhov
e2f61102 6d396ede

+14 -11
+14 -11
drivers/input/mouse/synaptics.c
··· 156 156 NULL 157 157 }; 158 158 159 + static bool matches_pnp_id(struct psmouse *psmouse, const char * const ids[]) 160 + { 161 + int i; 162 + 163 + if (!strncmp(psmouse->ps2dev.serio->firmware_id, "PNP:", 4)) 164 + for (i = 0; ids[i]; i++) 165 + if (strstr(psmouse->ps2dev.serio->firmware_id, ids[i])) 166 + return true; 167 + 168 + return false; 169 + } 170 + 159 171 /***************************************************************************** 160 172 * Synaptics communications functions 161 173 ****************************************************************************/ ··· 1377 1365 1378 1366 if (SYN_CAP_CLICKPAD(priv->ext_cap_0c)) { 1379 1367 __set_bit(INPUT_PROP_BUTTONPAD, dev->propbit); 1380 - /* See if this buttonpad has a top button area */ 1381 - if (!strncmp(psmouse->ps2dev.serio->firmware_id, "PNP:", 4)) { 1382 - for (i = 0; topbuttonpad_pnp_ids[i]; i++) { 1383 - if (strstr(psmouse->ps2dev.serio->firmware_id, 1384 - topbuttonpad_pnp_ids[i])) { 1385 - __set_bit(INPUT_PROP_TOPBUTTONPAD, 1386 - dev->propbit); 1387 - break; 1388 - } 1389 - } 1390 - } 1368 + if (matches_pnp_id(psmouse, topbuttonpad_pnp_ids)) 1369 + __set_bit(INPUT_PROP_TOPBUTTONPAD, dev->propbit); 1391 1370 /* Clickpads report only left button */ 1392 1371 __clear_bit(BTN_RIGHT, dev->keybit); 1393 1372 __clear_bit(BTN_MIDDLE, dev->keybit);