]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
net: lan743x: convert to use .get_rx_ring_count
authorBreno Leitao <leitao@debian.org>
Thu, 15 Jan 2026 14:37:52 +0000 (06:37 -0800)
committerJakub Kicinski <kuba@kernel.org>
Sun, 18 Jan 2026 02:10:16 +0000 (18:10 -0800)
Use the newly introduced .get_rx_ring_count ethtool ops callback instead
of handling ETHTOOL_GRXRINGS directly in .get_rxnfc().

Since ETHTOOL_GRXRINGS was the only command handled by
lan743x_ethtool_get_rxnfc(), remove the function entirely.

Signed-off-by: Breno Leitao <leitao@debian.org>
Link: https://patch.msgid.link/20260115-grxring_big_v2-v1-5-b3e1b58bced5@debian.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/microchip/lan743x_ethtool.c

index 40002d9fe27499c1bcf4a1ed86c69d7e8d75bb2b..8a3c1ecc7866cfda2d3d33882d22d75a8ea62cfc 100644 (file)
@@ -931,16 +931,9 @@ static int lan743x_ethtool_get_rxfh_fields(struct net_device *netdev,
        return 0;
 }
 
-static int lan743x_ethtool_get_rxnfc(struct net_device *netdev,
-                                    struct ethtool_rxnfc *rxnfc,
-                                    u32 *rule_locs)
+static u32 lan743x_ethtool_get_rx_ring_count(struct net_device *netdev)
 {
-       switch (rxnfc->cmd) {
-       case ETHTOOL_GRXRINGS:
-               rxnfc->data = LAN743X_USED_RX_CHANNELS;
-               return 0;
-       }
-       return -EOPNOTSUPP;
+       return LAN743X_USED_RX_CHANNELS;
 }
 
 static u32 lan743x_ethtool_get_rxfh_key_size(struct net_device *netdev)
@@ -1369,7 +1362,7 @@ const struct ethtool_ops lan743x_ethtool_ops = {
        .get_priv_flags = lan743x_ethtool_get_priv_flags,
        .set_priv_flags = lan743x_ethtool_set_priv_flags,
        .get_sset_count = lan743x_ethtool_get_sset_count,
-       .get_rxnfc = lan743x_ethtool_get_rxnfc,
+       .get_rx_ring_count = lan743x_ethtool_get_rx_ring_count,
        .get_rxfh_key_size = lan743x_ethtool_get_rxfh_key_size,
        .get_rxfh_indir_size = lan743x_ethtool_get_rxfh_indir_size,
        .get_rxfh = lan743x_ethtool_get_rxfh,