Fix and prevent bugs in device_register()
When adding to the global device list, we were adding devices just after their parent, while we wanted to add them just before. That way when we iterate over the list on suspend and shutdown, we'll hit all children before the parents. Make sure dev->driver_list and dev->bus_list are initialized when the device is registered Remove device from global and parent's list if registration failed.
Showing
Please register or sign in to comment