[PATCH weston 2/4] input: make a function for device removal
Jonas Ådahl
jadahl at gmail.com
Tue Sep 29 19:44:59 PDT 2015
On Tue, May 05, 2015 at 03:01:52PM -0500, Derek Foreman wrote:
> Break device_removed() out into its own function like device_added().
>
> Signed-off-by: Derek Foreman <derekf at osg.samsung.com>
With one nit below, this is Reviewed-by: Jonas Ådahl <jadahl at gmail.com>
> ---
> src/libinput-seat.c | 12 +++++++++---
> 1 file changed, 9 insertions(+), 3 deletions(-)
>
> diff --git a/src/libinput-seat.c b/src/libinput-seat.c
> index 19116ec..410df0e 100644
> --- a/src/libinput-seat.c
> +++ b/src/libinput-seat.c
> @@ -105,6 +105,14 @@ device_added(struct udev_input *input, struct libinput_device *libinput_device)
> }
>
> static void
> +device_removed(struct udev_input *input, struct libinput_device *libinput_device)
> +{
> + struct evdev_device *device;
nit: Missing empty line.
Jonas
> + device = libinput_device_get_user_data(libinput_device);
> + evdev_device_destroy(device);
> +}
> +
> +static void
> udev_seat_remove_devices(struct udev_seat *seat)
> {
> struct evdev_device *device, *next;
> @@ -132,7 +140,6 @@ udev_input_process_event(struct libinput_event *event)
> struct libinput_device *libinput_device =
> libinput_event_get_device(event);
> struct udev_input *input = libinput_get_user_data(libinput);
> - struct evdev_device *device;
> int handled = 1;
>
> switch (libinput_event_get_type(event)) {
> @@ -140,8 +147,7 @@ udev_input_process_event(struct libinput_event *event)
> device_added(input, libinput_device);
> break;
> case LIBINPUT_EVENT_DEVICE_REMOVED:
> - device = libinput_device_get_user_data(libinput_device);
> - evdev_device_destroy(device);
> + device_removed(input, libinput_device);
> break;
> default:
> handled = 0;
> --
> 2.1.4
>
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel
More information about the wayland-devel
mailing list