net: stmmac: add platform init/exit for Altera's ARM socfpga
[pandora-kernel.git] / drivers / net / ethernet / stmicro / stmmac / stmmac_main.c
index 0f4841d..18315f3 100644 (file)
@@ -1753,7 +1753,7 @@ static int stmmac_open(struct net_device *dev)
        }
 
        /* Request the IRQ lines */
-       if (priv->lpi_irq != -ENXIO) {
+       if (priv->lpi_irq > 0) {
                ret = request_irq(priv->lpi_irq, stmmac_interrupt, IRQF_SHARED,
                                  dev->name, dev);
                if (unlikely(ret < 0)) {
@@ -1813,7 +1813,7 @@ static int stmmac_release(struct net_device *dev)
        free_irq(dev->irq, dev);
        if (priv->wol_irq != dev->irq)
                free_irq(priv->wol_irq, dev);
-       if (priv->lpi_irq != -ENXIO)
+       if (priv->lpi_irq > 0)
                free_irq(priv->lpi_irq, dev);
 
        /* Stop TX/RX DMA and clear the descriptors */
@@ -2212,27 +2212,6 @@ static void stmmac_tx_timeout(struct net_device *dev)
        stmmac_tx_err(priv);
 }
 
-/* Configuration changes (passed on by ifconfig) */
-static int stmmac_config(struct net_device *dev, struct ifmap *map)
-{
-       if (dev->flags & IFF_UP)        /* can't act on a running interface */
-               return -EBUSY;
-
-       /* Don't allow changing the I/O address */
-       if (map->base_addr != dev->base_addr) {
-               pr_warn("%s: can't change I/O address\n", dev->name);
-               return -EOPNOTSUPP;
-       }
-
-       /* Don't allow changing the IRQ */
-       if (map->irq != dev->irq) {
-               pr_warn("%s: not change IRQ number %d\n", dev->name, dev->irq);
-               return -EOPNOTSUPP;
-       }
-
-       return 0;
-}
-
 /**
  *  stmmac_set_rx_mode - entry point for multicast addressing
  *  @dev : pointer to the device structure
@@ -2598,7 +2577,6 @@ static const struct net_device_ops stmmac_netdev_ops = {
        .ndo_set_rx_mode = stmmac_set_rx_mode,
        .ndo_tx_timeout = stmmac_tx_timeout,
        .ndo_do_ioctl = stmmac_ioctl,
-       .ndo_set_config = stmmac_config,
 #ifdef CONFIG_NET_POLL_CONTROLLER
        .ndo_poll_controller = stmmac_poll_controller,
 #endif
@@ -2900,6 +2878,10 @@ int stmmac_suspend(struct net_device *ndev)
                clk_disable_unprepare(priv->stmmac_clk);
        }
        spin_unlock_irqrestore(&priv->lock, flags);
+
+       priv->oldlink = 0;
+       priv->speed = 0;
+       priv->oldduplex = -1;
        return 0;
 }