• Johan Hovold's avatar
    USB: of: fix root-hub device-tree node handling · 2bf69867
    Johan Hovold authored
    In an attempt to work around a pinmux over-allocation issue in driver
    core, commit dc5878ab ("usb: core: move root hub's device node
    assignment after it is added to bus") moved the device-tree node
    assignment until after the root hub had been registered.
    
    This not only makes the device-tree node unavailable to the usb driver
    during probe, but also prevents the of_node from being linked to in
    sysfs and causes a race with user-space for the (recently added) devspec
    attribute.
    
    Use the new device_set_of_node_from_dev() helper to reuse the node of
    the sysdev device, something which now prevents driver core from trying
    to reclaim any pinctrl pins during probe.
    
    Fixes: dc5878ab ("usb: core: move root hub's device node assignment after it is added to bus")
    Fixes: 51fa9147 ("usb/core: Added devspec sysfs entry for devices behind the usb hub")
    Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    2bf69867
hcd.c 88 KB