• Johan Hovold's avatar
    net: ethernet: ti: cpsw: fix deferred probe · a4e32b0d
    Johan Hovold authored
    Make sure to deregister all child devices also on probe errors to avoid
    leaks and to fix probe deferral:
    
    cpsw 4a100000.ethernet: omap_device: omap_device_enable() called from invalid state 1
    cpsw 4a100000.ethernet: use pm_runtime_put_sync_suspend() in driver?
    cpsw: probe of 4a100000.ethernet failed with error -22
    
    Add generic helper to undo the effects of cpsw_probe_dt(), which will
    also be used in a follow-on patch to fix further leaks that have been
    introduced more recently.
    
    Note that the platform device is now runtime-resumed before registering
    any child devices in order to make sure that it is synchronously
    suspended after having deregistered the children in the error path.
    
    Fixes: 1fb19aa7 ("net: cpsw: Add parent<->child relation support
    between cpsw and mdio")
    Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    a4e32b0d
cpsw.c 76.9 KB