Skip to content

Commit

Permalink
rocker: return -EOPNOTSUPP for undefined world ops
Browse files Browse the repository at this point in the history
Suggested-by: Scott Feldman <sfeldma@gmail.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Jiri Pirko authored and David S. Miller committed Feb 18, 2016
1 parent 3fbcdbf commit fccd84d
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions drivers/net/ethernet/rocker/rocker_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1547,7 +1547,7 @@ static int rocker_world_port_attr_stp_state_set(struct rocker_port *rocker_port,
struct rocker_world_ops *wops = rocker_port->rocker->wops;

if (!wops->port_attr_stp_state_set)
return 0;
return -EOPNOTSUPP;
return wops->port_attr_stp_state_set(rocker_port, state, trans);
}

Expand All @@ -1559,7 +1559,7 @@ rocker_world_port_attr_bridge_flags_set(struct rocker_port *rocker_port,
struct rocker_world_ops *wops = rocker_port->rocker->wops;

if (!wops->port_attr_bridge_flags_set)
return 0;
return -EOPNOTSUPP;
return wops->port_attr_bridge_flags_set(rocker_port, brport_flags,
trans);
}
Expand All @@ -1571,7 +1571,7 @@ rocker_world_port_attr_bridge_flags_get(const struct rocker_port *rocker_port,
struct rocker_world_ops *wops = rocker_port->rocker->wops;

if (!wops->port_attr_bridge_flags_get)
return 0;
return -EOPNOTSUPP;
return wops->port_attr_bridge_flags_get(rocker_port, p_brport_flags);
}

Expand All @@ -1584,7 +1584,7 @@ rocker_world_port_attr_bridge_ageing_time_set(struct rocker_port *rocker_port,
struct rocker_world_ops *wops = rocker_port->rocker->wops;

if (!wops->port_attr_bridge_ageing_time_set)
return 0;
return -EOPNOTSUPP;
return wops->port_attr_bridge_ageing_time_set(rocker_port, ageing_time,
trans);
}
Expand All @@ -1597,6 +1597,7 @@ rocker_world_port_obj_vlan_add(struct rocker_port *rocker_port,
struct rocker_world_ops *wops = rocker_port->rocker->wops;

if (!wops->port_obj_vlan_add)
return -EOPNOTSUPP;
return 0;
return wops->port_obj_vlan_add(rocker_port, vlan, trans);
}
Expand All @@ -1608,7 +1609,7 @@ rocker_world_port_obj_vlan_del(struct rocker_port *rocker_port,
struct rocker_world_ops *wops = rocker_port->rocker->wops;

if (!wops->port_obj_vlan_del)
return 0;
return -EOPNOTSUPP;
return wops->port_obj_vlan_del(rocker_port, vlan);
}

Expand All @@ -1620,7 +1621,7 @@ rocker_world_port_obj_vlan_dump(const struct rocker_port *rocker_port,
struct rocker_world_ops *wops = rocker_port->rocker->wops;

if (!wops->port_obj_vlan_dump)
return 0;
return -EOPNOTSUPP;
return wops->port_obj_vlan_dump(rocker_port, vlan, cb);
}

Expand All @@ -1632,7 +1633,7 @@ rocker_world_port_obj_fib4_add(struct rocker_port *rocker_port,
struct rocker_world_ops *wops = rocker_port->rocker->wops;

if (!wops->port_obj_fib4_add)
return 0;
return -EOPNOTSUPP;
return wops->port_obj_fib4_add(rocker_port, fib4, trans);
}

Expand All @@ -1643,7 +1644,7 @@ rocker_world_port_obj_fib4_del(struct rocker_port *rocker_port,
struct rocker_world_ops *wops = rocker_port->rocker->wops;

if (!wops->port_obj_fib4_del)
return 0;
return -EOPNOTSUPP;
return wops->port_obj_fib4_del(rocker_port, fib4);
}

Expand All @@ -1655,7 +1656,7 @@ rocker_world_port_obj_fdb_add(struct rocker_port *rocker_port,
struct rocker_world_ops *wops = rocker_port->rocker->wops;

if (!wops->port_obj_fdb_add)
return 0;
return -EOPNOTSUPP;
return wops->port_obj_fdb_add(rocker_port, fdb, trans);
}

Expand All @@ -1666,7 +1667,7 @@ rocker_world_port_obj_fdb_del(struct rocker_port *rocker_port,
struct rocker_world_ops *wops = rocker_port->rocker->wops;

if (!wops->port_obj_fdb_del)
return 0;
return -EOPNOTSUPP;
return wops->port_obj_fdb_del(rocker_port, fdb);
}

Expand All @@ -1678,7 +1679,7 @@ rocker_world_port_obj_fdb_dump(const struct rocker_port *rocker_port,
struct rocker_world_ops *wops = rocker_port->rocker->wops;

if (!wops->port_obj_fdb_dump)
return 0;
return -EOPNOTSUPP;
return wops->port_obj_fdb_dump(rocker_port, fdb, cb);
}

Expand All @@ -1688,7 +1689,7 @@ static int rocker_world_port_master_linked(struct rocker_port *rocker_port,
struct rocker_world_ops *wops = rocker_port->rocker->wops;

if (!wops->port_master_linked)
return 0;
return -EOPNOTSUPP;
return wops->port_master_linked(rocker_port, master);
}

Expand All @@ -1698,7 +1699,7 @@ static int rocker_world_port_master_unlinked(struct rocker_port *rocker_port,
struct rocker_world_ops *wops = rocker_port->rocker->wops;

if (!wops->port_master_unlinked)
return 0;
return -EOPNOTSUPP;
return wops->port_master_unlinked(rocker_port, master);
}

Expand All @@ -1708,7 +1709,7 @@ static int rocker_world_port_neigh_update(struct rocker_port *rocker_port,
struct rocker_world_ops *wops = rocker_port->rocker->wops;

if (!wops->port_neigh_update)
return 0;
return -EOPNOTSUPP;
return wops->port_neigh_update(rocker_port, n);
}

Expand All @@ -1718,7 +1719,7 @@ static int rocker_world_port_neigh_destroy(struct rocker_port *rocker_port,
struct rocker_world_ops *wops = rocker_port->rocker->wops;

if (!wops->port_neigh_destroy)
return 0;
return -EOPNOTSUPP;
return wops->port_neigh_destroy(rocker_port, n);
}

Expand All @@ -1729,7 +1730,7 @@ static int rocker_world_port_ev_mac_vlan_seen(struct rocker_port *rocker_port,
struct rocker_world_ops *wops = rocker_port->rocker->wops;

if (!wops->port_ev_mac_vlan_seen)
return 0;
return -EOPNOTSUPP;
return wops->port_ev_mac_vlan_seen(rocker_port, addr, vlan_id);
}

Expand Down

0 comments on commit fccd84d

Please sign in to comment.