mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2025-12-20 18:30:06 +01:00
touchpad: change the sanity check function to a bool
And rename to make the return value more obvious Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Yong Bakos <ybakos@humanoriented.com> Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
This commit is contained in:
parent
bc84245ec3
commit
a5066edaaf
1 changed files with 7 additions and 7 deletions
|
|
@ -2081,8 +2081,8 @@ out:
|
||||||
device->devname);
|
device->devname);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static bool
|
||||||
tp_sanity_check(struct tp_dispatch *tp,
|
tp_pass_sanity_check(struct tp_dispatch *tp,
|
||||||
struct evdev_device *device)
|
struct evdev_device *device)
|
||||||
{
|
{
|
||||||
struct libevdev *evdev = device->evdev;
|
struct libevdev *evdev = device->evdev;
|
||||||
|
|
@ -2097,13 +2097,13 @@ tp_sanity_check(struct tp_dispatch *tp,
|
||||||
if (!libevdev_has_event_code(evdev, EV_KEY, BTN_TOOL_FINGER))
|
if (!libevdev_has_event_code(evdev, EV_KEY, BTN_TOOL_FINGER))
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
return 0;
|
return true;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
log_bug_kernel(libinput,
|
log_bug_kernel(libinput,
|
||||||
"device %s failed touchpad sanity checks\n",
|
"device %s failed touchpad sanity checks\n",
|
||||||
device->devname);
|
device->devname);
|
||||||
return -1;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
@ -2183,8 +2183,8 @@ tp_init(struct tp_dispatch *tp,
|
||||||
tp->base.interface = &tp_interface;
|
tp->base.interface = &tp_interface;
|
||||||
tp->device = device;
|
tp->device = device;
|
||||||
|
|
||||||
if (tp_sanity_check(tp, device) != 0)
|
if (!tp_pass_sanity_check(tp, device))
|
||||||
return -1;
|
return false;
|
||||||
|
|
||||||
tp_init_default_resolution(tp, device);
|
tp_init_default_resolution(tp, device);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue