From: Furong Xu <0x1207@gmail.com> Date: Fri, 1 Nov 2024 13:31:32 +0000 (+0800) Subject: net: stmmac: Get the TC number of net_device by netdev_get_num_tc() X-Git-Tag: v6.13-rc1~135^2~149^2~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2558fe30ae8bfc178284e29e9adb2ecac69db139;p=thirdparty%2Fkernel%2Flinux.git net: stmmac: Get the TC number of net_device by netdev_get_num_tc() netdev_get_num_tc() is the right method, we should not access net_device.num_tc directly. Signed-off-by: Furong Xu <0x1207@gmail.com> Reviewed-by: Vladimir Oltean Link: https://patch.msgid.link/6298463f4655a76faf94e4273a4205c13ca17c77.1730449003.git.0x1207@gmail.com Signed-off-by: Jakub Kicinski --- diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_fpe.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_fpe.c index affb68604b969..ab717c9bba417 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_fpe.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_fpe.c @@ -304,7 +304,7 @@ int dwmac5_fpe_map_preemption_class(struct net_device *ndev, { u32 val, offset, count, queue_weight, preemptible_txqs = 0; struct stmmac_priv *priv = netdev_priv(ndev); - u32 num_tc = ndev->num_tc; + int num_tc = netdev_get_num_tc(ndev); if (!pclass) goto update_mapping;