Commit 662981bb authored by Vladimir Oltean's avatar Vladimir Oltean Committed by Jakub Kicinski

net: mscc: ocelot: rename ocelot_netdevice_port_event to ocelot_netdevice_changeupper

ocelot_netdevice_port_event treats a single event, NETDEV_CHANGEUPPER.
So we can remove the check for the type of event, and rename the
function to be more suggestive, since there already is a function with a
very similar name of ocelot_netdevice_event.
Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 8d9dbce4
...@@ -1110,8 +1110,7 @@ static int ocelot_port_obj_del(struct net_device *dev, ...@@ -1110,8 +1110,7 @@ static int ocelot_port_obj_del(struct net_device *dev,
return ret; return ret;
} }
static int ocelot_netdevice_port_event(struct net_device *dev, static int ocelot_netdevice_changeupper(struct net_device *dev,
unsigned long event,
struct netdev_notifier_changeupper_info *info) struct netdev_notifier_changeupper_info *info)
{ {
struct ocelot_port_private *priv = netdev_priv(dev); struct ocelot_port_private *priv = netdev_priv(dev);
...@@ -1120,8 +1119,6 @@ static int ocelot_netdevice_port_event(struct net_device *dev, ...@@ -1120,8 +1119,6 @@ static int ocelot_netdevice_port_event(struct net_device *dev,
int port = priv->chip_port; int port = priv->chip_port;
int err = 0; int err = 0;
switch (event) {
case NETDEV_CHANGEUPPER:
if (netif_is_bridge_master(info->upper_dev)) { if (netif_is_bridge_master(info->upper_dev)) {
if (info->linking) { if (info->linking) {
err = ocelot_port_bridge_join(ocelot, port, err = ocelot_port_bridge_join(ocelot, port,
...@@ -1139,10 +1136,6 @@ static int ocelot_netdevice_port_event(struct net_device *dev, ...@@ -1139,10 +1136,6 @@ static int ocelot_netdevice_port_event(struct net_device *dev,
ocelot_port_lag_leave(ocelot, port, ocelot_port_lag_leave(ocelot, port,
info->upper_dev); info->upper_dev);
} }
break;
default:
break;
}
return err; return err;
} }
...@@ -1170,17 +1163,19 @@ static int ocelot_netdevice_event(struct notifier_block *unused, ...@@ -1170,17 +1163,19 @@ static int ocelot_netdevice_event(struct notifier_block *unused,
} }
} }
if (event == NETDEV_CHANGEUPPER) {
if (netif_is_lag_master(dev)) { if (netif_is_lag_master(dev)) {
struct net_device *slave; struct net_device *slave;
struct list_head *iter; struct list_head *iter;
netdev_for_each_lower_dev(dev, slave, iter) { netdev_for_each_lower_dev(dev, slave, iter) {
ret = ocelot_netdevice_port_event(slave, event, info); ret = ocelot_netdevice_changeupper(slave, info);
if (ret) if (ret)
goto notify; goto notify;
} }
} else { } else {
ret = ocelot_netdevice_port_event(dev, event, info); ret = ocelot_netdevice_changeupper(dev, info);
}
} }
notify: notify:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment