[CPUFREQ] Fix stale cpufreq_cpu_governor pointer
[safe/jmp/linux-2.6] / drivers / net / jazzsonic.c
index 14248cf..6e5b3f3 100644 (file)
@@ -96,7 +96,19 @@ static int jazzsonic_close(struct net_device* dev)
        return err;
 }
 
-static int __init sonic_probe1(struct net_device *dev)
+static const struct net_device_ops sonic_netdev_ops = {
+       .ndo_open               = jazzsonic_open,
+       .ndo_stop               = jazzsonic_close,
+       .ndo_start_xmit         = sonic_send_packet,
+       .ndo_get_stats          = sonic_get_stats,
+       .ndo_set_multicast_list = sonic_multicast_list,
+       .ndo_tx_timeout         = sonic_tx_timeout,
+       .ndo_change_mtu         = eth_change_mtu,
+       .ndo_validate_addr      = eth_validate_addr,
+       .ndo_set_mac_address    = eth_mac_addr,
+};
+
+static int __devinit sonic_probe1(struct net_device *dev)
 {
        static unsigned version_printed;
        unsigned int silicon_revision;
@@ -179,12 +191,7 @@ static int __init sonic_probe1(struct net_device *dev)
        lp->rra_laddr = lp->rda_laddr + (SIZEOF_SONIC_RD * SONIC_NUM_RDS
                             * SONIC_BUS_SCALE(lp->dma_bitmode));
 
-       dev->open = jazzsonic_open;
-       dev->stop = jazzsonic_close;
-       dev->hard_start_xmit = sonic_send_packet;
-       dev->get_stats = sonic_get_stats;
-       dev->set_multicast_list = &sonic_multicast_list;
-       dev->tx_timeout = sonic_tx_timeout;
+       dev->netdev_ops = &sonic_netdev_ops;
        dev->watchdog_timeo = TX_TIMEOUT;
 
        /*
@@ -196,7 +203,7 @@ static int __init sonic_probe1(struct net_device *dev)
 
        return 0;
 out:
-       release_region(dev->base_addr, SONIC_MEM_SIZE);
+       release_mem_region(dev->base_addr, SONIC_MEM_SIZE);
        return err;
 }
 
@@ -204,7 +211,7 @@ out:
  * Probe for a SONIC ethernet controller on a Mips Jazz board.
  * Actually probing is superfluous but we're paranoid.
  */
-static int __init jazz_sonic_probe(struct platform_device *pdev)
+static int __devinit jazz_sonic_probe(struct platform_device *pdev)
 {
        struct net_device *dev;
        struct sonic_local *lp;
@@ -222,6 +229,7 @@ static int __init jazz_sonic_probe(struct platform_device *pdev)
        lp = netdev_priv(dev);
        lp->device = &pdev->dev;
        SET_NETDEV_DEV(dev, &pdev->dev);
+       platform_set_drvdata(pdev, dev);
 
        netdev_boot_setup_check(dev);
 
@@ -239,7 +247,7 @@ static int __init jazz_sonic_probe(struct platform_device *pdev)
        return 0;
 
 out1:
-       release_region(dev->base_addr, SONIC_MEM_SIZE);
+       release_mem_region(dev->base_addr, SONIC_MEM_SIZE);
 out:
        free_netdev(dev);
 
@@ -261,7 +269,7 @@ static int __devexit jazz_sonic_device_remove (struct platform_device *pdev)
        unregister_netdev(dev);
        dma_free_coherent(lp->device, SIZEOF_SONIC_DESC * SONIC_BUS_SCALE(lp->dma_bitmode),
                          lp->descriptors, lp->descriptors_laddr);
-       release_region (dev->base_addr, SONIC_MEM_SIZE);
+       release_mem_region(dev->base_addr, SONIC_MEM_SIZE);
        free_netdev(dev);
 
        return 0;