• Vladimir Oltean's avatar
    net: dsa: walk through all changeupper notifier functions · 4c3f80d2
    Vladimir Oltean authored
    Traditionally, DSA has had a single netdev notifier handling function
    for each device type.
    
    For the sake of code cleanliness, we would like to introduce more
    handling functions which do one thing, but the conditions for entering
    these functions start to overlap. Example: a handling function which
    tracks whether any bridges contain both DSA and non-DSA interfaces.
    Either this is placed before dsa_slave_changeupper(), case in which it
    will prevent that function from executing, or we place it after
    dsa_slave_changeupper(), case in which we will prevent it from
    executing. The other alternative is to ignore errors from the new
    handling function (not ideal).
    
    To support this usage, we need to change the pattern. In the new model,
    we enter all notifier handling sub-functions, and exit with NOTIFY_DONE
    if there is nothing to do. This allows the sub-functions to be
    relatively free-form and independent from each other.
    Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
    Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
    Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
    4c3f80d2
slave.c 76.1 KB