From 9ce1343d28b14444d873f2a1d992967d253433ff Mon Sep 17 00:00:00 2001 From: Mikel Astiz Date: Fri, 26 Apr 2013 08:17:02 +0200 Subject: [PATCH] input: Fix ignored profile shutdown Unprobing the profile should never fail which means neither should input_device_unregister(). This requires shutting everything down regardless of possible pending connection requests. --- profiles/input/device.c | 11 ++--------- profiles/input/device.h | 2 +- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/profiles/input/device.c b/profiles/input/device.c index 4af95d860..161d8af2f 100644 --- a/profiles/input/device.c +++ b/profiles/input/device.c @@ -903,7 +903,7 @@ static struct input_device *find_device(const bdaddr_t *src, return NULL; } -int input_device_unregister(const char *path, const char *uuid) +void input_device_unregister(const char *path, const char *uuid) { struct input_device *idev; @@ -911,20 +911,13 @@ int input_device_unregister(const char *path, const char *uuid) idev = find_device_by_path(devices, path); if (idev == NULL) - return -EINVAL; - - if (idev->ctrl_io) { - /* Pending connection running */ - return -EBUSY; - } + return; g_dbus_unregister_interface(btd_get_dbus_connection(), idev->path, INPUT_INTERFACE); devices = g_slist_remove(devices, idev); input_device_free(idev); - - return 0; } static int input_device_connadd(struct input_device *idev) diff --git a/profiles/input/device.h b/profiles/input/device.h index aabc79c39..db69053da 100644 --- a/profiles/input/device.h +++ b/profiles/input/device.h @@ -30,7 +30,7 @@ struct input_conn; int input_device_register(struct btd_device *device, const char *path, const char *uuid, const sdp_record_t *rec, int timeout); -int input_device_unregister(const char *path, const char *uuid); +void input_device_unregister(const char *path, const char *uuid); int input_device_set_channel(const bdaddr_t *src, const bdaddr_t *dst, int psm, GIOChannel *io); -- 2.47.3