touchpad: use the model flags to determine internal vs external

When pairing a trackpoint, use the model flags for the touchpad, don't
use a separate set of conditions.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2021-09-20 11:56:11 +10:00
parent 5f966dc6c6
commit ea7a88d213

View file

@ -2406,14 +2406,13 @@ tp_pair_trackpoint(struct evdev_device *touchpad,
struct evdev_device *trackpoint)
{
struct tp_dispatch *tp = (struct tp_dispatch*)touchpad->dispatch;
unsigned int bus_tp = libevdev_get_id_bustype(touchpad->evdev),
bus_trp = libevdev_get_id_bustype(trackpoint->evdev);
unsigned int bus_trp = libevdev_get_id_bustype(trackpoint->evdev);
bool tp_is_internal, trp_is_internal;
if ((trackpoint->tags & EVDEV_TAG_TRACKPOINT) == 0)
return;
tp_is_internal = bus_tp != BUS_USB && bus_tp != BUS_BLUETOOTH;
tp_is_internal = !!(touchpad->tags & EVDEV_TAG_INTERNAL_TOUCHPAD);
trp_is_internal = bus_trp != BUS_USB && bus_trp != BUS_BLUETOOTH;
if (tp->buttons.trackpoint == NULL &&