mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/
synced 2026-04-18 06:33:43 -04:00
Input: psmouse - add psmouse_matches_pnp_id helper function
The matches_pnp_id function from the synaptics driver is useful for other drivers too. Make it a generic psmouse helper function. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
This commit is contained in:
committed by
Dmitry Torokhov
parent
76460a7bec
commit
2c75ada625
@@ -462,6 +462,20 @@ static int psmouse_poll(struct psmouse *psmouse)
|
||||
PSMOUSE_CMD_POLL | (psmouse->pktsize << 8));
|
||||
}
|
||||
|
||||
/*
|
||||
* psmouse_matches_pnp_id - check if psmouse matches one of the passed in ids.
|
||||
*/
|
||||
bool psmouse_matches_pnp_id(struct psmouse *psmouse, const char * const ids[])
|
||||
{
|
||||
int i;
|
||||
|
||||
if (!strncmp(psmouse->ps2dev.serio->firmware_id, "PNP:", 4))
|
||||
for (i = 0; ids[i]; i++)
|
||||
if (strstr(psmouse->ps2dev.serio->firmware_id, ids[i]))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
* Genius NetMouse magic init.
|
||||
|
||||
Reference in New Issue
Block a user