Skip to content

Commit

Permalink
Fix compilation errors
Browse files Browse the repository at this point in the history
  • Loading branch information
k1-801 committed Dec 3, 2023
1 parent f0eef03 commit fc3491c
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions linux/hid.c
Original file line number Diff line number Diff line change
Expand Up @@ -857,6 +857,18 @@ static struct hid_hotplug_context {
.devs = NULL
};

struct hid_hotplug_callback {
hid_hotplug_callback_handle handle;
unsigned short vendor_id;
unsigned short product_id;
hid_hotplug_event events;
void *user_data;
hid_hotplug_callback_fn callback;

/* Pointer to the next notification */
struct hid_hotplug_callback *next;
};

static void hid_internal_hotplug_cleanup()
{
if (hid_hotplug_context.hotplug_cbs != NULL) {
Expand Down Expand Up @@ -886,10 +898,10 @@ static void hid_internal_hotplug_exit()
}

pthread_mutex_lock(&hid_hotplug_context.mutex);
hid_hotplug_callback** current = &hid_hotplug_context.hotplug_cbs
struct hid_hotplug_callback **current = &hid_hotplug_context.hotplug_cbs;
/* Remove all callbacks from the list */
while (*current) {
hid_hotplug_callback* next = (*current)->next;
struct hid_hotplug_callback* next = (*current)->next;
free(*current);
*current = next;
}
Expand Down Expand Up @@ -1031,18 +1043,6 @@ void HID_API_EXPORT hid_free_enumeration(struct hid_device_info *devs)
}
}

struct hid_hotplug_callback {
hid_hotplug_callback_handle handle;
unsigned short vendor_id;
unsigned short product_id;
hid_hotplug_event events;
void *user_data;
hid_hotplug_callback_fn callback;

/* Pointer to the next notification */
struct hid_hotplug_callback *next;
};

static void hid_internal_invoke_callbacks(struct hid_device_info *info, hid_hotplug_event event)
{
struct hid_hotplug_callback **current = &hid_hotplug_context.hotplug_cbs;
Expand Down Expand Up @@ -1254,7 +1254,7 @@ int HID_API_EXPORT HID_API_CALL hid_hotplug_deregister_callback(hid_hotplug_call
}
}

hid_internal_cleanup_hotplugs();
hid_internal_hotplug_cleanup();

pthread_mutex_unlock(&hid_hotplug_context.mutex);

Expand Down

0 comments on commit fc3491c

Please sign in to comment.