mlxsw: spectrum: Don't assume upper device's type
authorIdo Schimmel <idosch@mellanox.com>
Fri, 10 Mar 2017 07:53:35 +0000 (08:53 +0100)
committerDavid S. Miller <davem@davemloft.net>
Fri, 10 Mar 2017 17:36:06 +0000 (09:36 -0800)
commit1f88061ee409f5ec3d3451fc3235965aa3789af1
tree1ba4be8c79dbf43e41ea7f88ac2afc22b6d3b052
parentb414970e210d39d81cc70b46f7d9aa8e07b9297f
mlxsw: spectrum: Don't assume upper device's type

When an upper device is configured on top of a vPort we make sure it's a
bridge master during PRECHANGEUPPER and fail otherwise. Therefore, when
CHANGEUPPER is later received we don't bother checking the upper's type.

Make the code more extendable in preparation for VRF uppers, by checking
the upper's type.

Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum.c