diff --git a/input/drivers_hid/iohidmanager_hid.c b/input/drivers_hid/iohidmanager_hid.c index 602391af01..fb312f6e7c 100644 --- a/input/drivers_hid/iohidmanager_hid.c +++ b/input/drivers_hid/iohidmanager_hid.c @@ -1005,76 +1005,6 @@ static int iohidmanager_hid_manager_free(iohidmanager_hid_t *hid) static int iohidmanager_hid_manager_set_device_matching( iohidmanager_hid_t *hid) { - /* deterministically add all device currently plugged when lanching retroarch - * order by location id which seems to correspond to usb port number */ - CFSetRef set = IOHIDManagerCopyDevices(hid->ptr); - CFIndex num_devices = CFSetGetCount(set); - IOHIDDeviceRef *device_array = (IOHIDDeviceRef*)calloc(num_devices, sizeof(IOHIDDeviceRef)); - CFSetGetValues(set, (const void **) device_array); - CFRelease(set); - /* re order device by location id */ - typedef struct hid_list - { - IOHIDDeviceRef device; - uint32_t lid; - struct hid_list *next; - } hid_list_t; - - hid_list_t* devList = NULL; - for (long i=0; idevice = dev; - devList->lid = iohidmanager_hid_device_get_location_id(dev); - devList->next = NULL; - } - else - { - hid_list_t * devnew = (hid_list_t *)malloc(sizeof(hid_list_t)); - devnew->device = dev; - devnew->lid = iohidmanager_hid_device_get_location_id(dev); - devnew->next = NULL; - - hid_list_t * ptr = devList; - if (devnew->lid < ptr->lid) - { - devnew->next = ptr; - devList = devnew; - } - else - { - while ( ( ptr->lid < devnew->lid ) && (ptr->next != NULL) ) - ptr = ptr->next; - devnew->next = ptr->next; - ptr->next = devnew; - } - } - } - } - - /* register devices */ - hid_list_t * ptr = devList; - while (ptr != NULL) - { - - iohidmanager_hid_device_add(ptr->device, hid); - - - ptr = ptr->next; - free(devList); - devList = ptr; - } - free(device_array); - - /* register call back to dynamically add device plugged when retroarch is * running * those will be added after the one plugged when retroarch was launched,