mlxsw: Convert resources into array
authorJiri Pirko <jiri@mellanox.com>
Fri, 21 Oct 2016 14:07:23 +0000 (16:07 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sun, 23 Oct 2016 21:21:29 +0000 (17:21 -0400)
commitc1a3831121f60f614fe92314d8c271d4d89d0a9a
treefde5cd59973f2e5cfca9641a8de79a43c3265094
parentf38a2314e55978e7b5c128175db27244665d0765
mlxsw: Convert resources into array

Since the number of resources is going to get much bigger, ease up the
addition by simly defining IDs. Convert the existing structure members
to a set array, one for validity, one for values. Introduce a set of
getters and setters for easy access.

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/core.c
drivers/net/ethernet/mellanox/mlxsw/core.h
drivers/net/ethernet/mellanox/mlxsw/pci.c
drivers/net/ethernet/mellanox/mlxsw/resources.h [new file with mode: 0644]
drivers/net/ethernet/mellanox/mlxsw/spectrum.c
drivers/net/ethernet/mellanox/mlxsw/spectrum.h
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c