• Petr Machata's avatar
    mlxsw: spectrum: Don't use resource ID of 0 · 59441fef
    Petr Machata authored
    In commit 14530746 ("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: 14530746 ("devlink: Remove top_hierarchy arg to devlink_resource_register")
    Signed-off-by: default avatarPetr Machata <petrm@mellanox.com>
    Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    59441fef
spectrum.h 22.7 KB