Commit f7be0f5e authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

winebus.sys: Return an event from UDEV bus wait on device creation.

And queued events generated from initial device enumeration. Instead of calling bus_create_hid_device. Signed-off-by: 's avatarRémi Bernon <rbernon@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 507a3076
......@@ -1098,7 +1098,6 @@ static void udev_add_device(struct udev_device *dev)
.input = -1,
};
struct platform_private *private;
DEVICE_OBJECT *device = NULL;
const char *subsystem;
const char *devnode;
int fd;
......@@ -1182,9 +1181,10 @@ static void udev_add_device(struct udev_device *dev)
EnterCriticalSection(&udev_cs);
list_add_tail(&device_list, &private->unix_device.entry);
LeaveCriticalSection(&udev_cs);
private->udev_device = udev_device_ref(dev);
private->device_fd = fd;
device = bus_create_hid_device(&desc, &private->unix_device);
if (!device) HeapFree(GetProcessHeap(), 0, private);
bus_event_queue_device_created(&event_queue, &private->unix_device, &desc);
}
#ifdef HAS_PROPER_INPUT_HEADER
else if (strcmp(subsystem, "input") == 0)
......@@ -1195,23 +1195,12 @@ static void udev_add_device(struct udev_device *dev)
EnterCriticalSection(&udev_cs);
list_add_tail(&device_list, &private->unix_device.entry);
LeaveCriticalSection(&udev_cs);
device = bus_create_hid_device(&desc, &private->unix_device);
if (!device) HeapFree(GetProcessHeap(), 0, private);
}
#endif
if (device)
{
private->udev_device = udev_device_ref(dev);
private->device_fd = fd;
IoInvalidateDeviceRelations(bus_pdo, BusRelations);
}
else
{
WARN("Ignoring device %s with subsystem %s\n", debugstr_a(devnode), subsystem);
close(fd);
bus_event_queue_device_created(&event_queue, &private->unix_device, &desc);
}
#endif
}
static void try_remove_device(struct udev_device *dev)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment