net: fec: validate the new settings in fec_enet_set_coalesce()
[platform/kernel/linux-rpi.git] / drivers / net / ethernet / freescale / fec_main.c
index 296ae1e..9142992 100644 (file)
@@ -2476,15 +2476,15 @@ fec_enet_set_coalesce(struct net_device *ndev, struct ethtool_coalesce *ec)
                return -EINVAL;
        }
 
-       cycle = fec_enet_us_to_itr_clock(ndev, fep->rx_time_itr);
+       cycle = fec_enet_us_to_itr_clock(ndev, ec->rx_coalesce_usecs);
        if (cycle > 0xFFFF) {
                pr_err("Rx coalesced usec exceed hardware limitation\n");
                return -EINVAL;
        }
 
-       cycle = fec_enet_us_to_itr_clock(ndev, fep->tx_time_itr);
+       cycle = fec_enet_us_to_itr_clock(ndev, ec->tx_coalesce_usecs);
        if (cycle > 0xFFFF) {
-               pr_err("Rx coalesced usec exceed hardware limitation\n");
+               pr_err("Tx coalesced usec exceed hardware limitation\n");
                return -EINVAL;
        }