From 4e311845798087edec56044d9ba82aa6177e5cf7 Mon Sep 17 00:00:00 2001 From: Dmitry Kychanov Date: Mon, 8 Apr 2024 18:01:19 +0400 Subject: [PATCH] Linux typos 2 --- libusb/hid.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libusb/hid.c b/libusb/hid.c index 5da6f653..6ec0afce 100644 --- a/libusb/hid.c +++ b/libusb/hid.c @@ -1344,8 +1344,6 @@ int HID_API_EXPORT HID_API_CALL hid_hotplug_register_callback(unsigned short ven int HID_API_EXPORT HID_API_CALL hid_hotplug_deregister_callback(hid_hotplug_callback_handle callback_handle) { - struct hid_hotplug_callback *hotplug_cb = NULL; - if (!libusb_has_capability(LIBUSB_CAP_HAS_HOTPLUG) || !hid_hotplug_context.mutex_state || callback_handle <= 0) { return -1; } @@ -1357,6 +1355,8 @@ int HID_API_EXPORT HID_API_CALL hid_hotplug_deregister_callback(hid_hotplug_call return -1; } + int result = -1; + /* Remove this notification */ for (struct hid_hotplug_callback **current = &hid_hotplug_context.hotplug_cbs; *current != NULL; current = &(*current)->next) { if ((*current)->handle == callback_handle) { @@ -1377,7 +1377,7 @@ int HID_API_EXPORT HID_API_CALL hid_hotplug_deregister_callback(hid_hotplug_call pthread_mutex_unlock(&hid_hotplug_context.mutex); - return 0; + return result; } hid_device * hid_open(unsigned short vendor_id, unsigned short product_id, const wchar_t *serial_number)