]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
net: stmmac: Get the TC number of net_device by netdev_get_num_tc()
authorFurong Xu <0x1207@gmail.com>
Fri, 1 Nov 2024 13:31:32 +0000 (21:31 +0800)
committerJakub Kicinski <kuba@kernel.org>
Sun, 3 Nov 2024 23:31:23 +0000 (15:31 -0800)
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 <olteanv@gmail.com>
Link: https://patch.msgid.link/6298463f4655a76faf94e4273a4205c13ca17c77.1730449003.git.0x1207@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/stmicro/stmmac/stmmac_fpe.c

index affb68604b96930cb96cd872a3f67a2cd9d4894b..ab717c9bba417e9af273bf95f7e18de545357984 100644 (file)
@@ -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;