kernel: remove obsolete kernel version switches
[openwrt/openwrt.git] / target / linux / ramips / files / drivers / net / ethernet / ralink / mtk_eth_soc.c
index cf6d4806edabf277169178bd6182d5107869ac08..b79b34893808c26149e54032515a08cd0593d5de 100644 (file)
@@ -1096,11 +1096,7 @@ poll_again:
        return rx_done;
 }
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0)
-static void fe_tx_timeout(struct net_device *dev)
-#else
 static void fe_tx_timeout(struct net_device *dev, unsigned int txqueue)
-#endif
 {
        struct fe_priv *priv = netdev_priv(dev);
        struct fe_tx_ring *ring = &priv->tx_ring;
@@ -1368,7 +1364,6 @@ static int __init fe_init(struct net_device *dev)
 {
        struct fe_priv *priv = netdev_priv(dev);
        struct device_node *port;
-       const char *mac_addr;
        int err;
 
        if (priv->soc->reset_fe)
@@ -1389,9 +1384,7 @@ static int __init fe_init(struct net_device *dev)
 
        fe_reset_phy(priv);
 
-       mac_addr = of_get_mac_address(priv->dev->of_node);
-       if (!IS_ERR_OR_NULL(mac_addr))
-               ether_addr_copy(dev->dev_addr, mac_addr);
+       of_get_mac_address(priv->dev->of_node, dev->dev_addr);
 
        /* If the mac address is invalid, use random mac address  */
        if (!is_valid_ether_addr(dev->dev_addr)) {
@@ -1564,7 +1557,9 @@ static int fe_probe(struct platform_device *pdev)
        struct clk *sysclk;
        int err, napi_weight;
 
-       device_reset(&pdev->dev);
+       err = device_reset(&pdev->dev);
+       if (err)
+               dev_err(&pdev->dev, "failed to reset device\n");
 
        match = of_match_device(of_fe_match, &pdev->dev);
        soc = (struct fe_soc_data *)match->data;