diff --git a/profiles/input/hog_device.c b/profiles/input/hog_device.c
index 4f5e99b..e2a3488 100644
--- a/profiles/input/hog_device.c
+++ b/profiles/input/hog_device.c
return 0;
}
-static void remove_device(gpointer hogdev, gpointer b)
+static void remove_device(gpointer a, gpointer b)
{
+ struct hog_device *hogdev = a;
+ struct btd_device *device = b;
+
+ if (hogdev->device != device)
+ return;
+
devices = g_slist_remove(devices, hogdev);
hog_device_unregister(hogdev);
}
DBG("path %s", path);
- g_slist_foreach(devices, remove_device, NULL);
+ g_slist_foreach(devices, remove_device, device);
}
static struct btd_profile hog_profile = {