mlxsw: spectrum: Don't use resource ID of 0
authorPetr Machata <petrm@mellanox.com>
Sun, 1 Apr 2018 14:34:59 +0000 (17:34 +0300)
committerDavid S. Miller <davem@davemloft.net>
Sun, 1 Apr 2018 14:56:43 +0000 (10:56 -0400)
commit59441fef2b10c651261be08aec558e90fbd594f8
tree230ba7148718abcfaf4586c4a3eb8ed51e598867
parent88d2fbcda145f5b256a254635c7420a2a645eca0
mlxsw: spectrum: Don't use resource ID of 0

In commit 145307460ba9 ("devlink: Remove top_hierarchy arg to
devlink_resource_register"), the "top_hierarchy" parameter to
devlink_resource_register() was removed in favor of using the parameter
"parent_resource_id" exclusively to determine who the parent is. The
root node's resource ID for this purpose is
DEVLINK_RESOURCE_ID_PARENT_TOP with the value 0. It is therefore
problematic that the resource MLXSW_SP_RESOURCE_KVD has also ID of 0.

Fix this by numbering driver-specific resources from 1.

Fixes: 145307460ba9 ("devlink: Remove top_hierarchy arg to devlink_resource_register")
Signed-off-by: Petr Machata <petrm@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum.h