• Patrick Mochel's avatar
    Fix and prevent bugs in device_register() · 266c24ad
    Patrick Mochel authored
    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.
    266c24ad
core.c 6.8 KB