[PATCH] Fix section mismatch in de2104x.c
[pandora-kernel.git] / drivers / net / tulip / de2104x.c
index fc2468e..f6b3a94 100644 (file)
@@ -31,7 +31,6 @@
 #define DRV_VERSION            "0.7"
 #define DRV_RELDATE            "Mar 17, 2004"
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/netdevice.h>
@@ -485,7 +484,7 @@ rx_next:
        de->rx_tail = rx_tail;
 }
 
-static irqreturn_t de_interrupt (int irq, void *dev_instance, struct pt_regs *regs)
+static irqreturn_t de_interrupt (int irq, void *dev_instance)
 {
        struct net_device *dev = dev_instance;
        struct de_private *de = dev->priv;
@@ -1372,7 +1371,7 @@ static int de_open (struct net_device *dev)
 
        dw32(IntrMask, 0);
 
-       rc = request_irq(dev->irq, de_interrupt, SA_SHIRQ, dev->name, dev);
+       rc = request_irq(dev->irq, de_interrupt, IRQF_SHARED, dev->name, dev);
        if (rc) {
                printk(KERN_ERR "%s: IRQ %d request failure, err=%d\n",
                       dev->name, dev->irq, rc);
@@ -1671,7 +1670,7 @@ static void de_get_regs(struct net_device *dev, struct ethtool_regs *regs,
        spin_unlock_irq(&de->lock);
 }
 
-static struct ethtool_ops de_ethtool_ops = {
+static const struct ethtool_ops de_ethtool_ops = {
        .get_link               = ethtool_op_get_link,
        .get_tx_csum            = ethtool_op_get_tx_csum,
        .get_sg                 = ethtool_op_get_sg,
@@ -1731,7 +1730,7 @@ static void __init de21040_get_media_info(struct de_private *de)
 }
 
 /* Note: this routine returns extra data bits for size detection. */
-static unsigned __init tulip_read_eeprom(void __iomem *regs, int location, int addr_len)
+static unsigned __devinit tulip_read_eeprom(void __iomem *regs, int location, int addr_len)
 {
        int i;
        unsigned retval = 0;
@@ -1927,7 +1926,7 @@ bad_srom:
        goto fill_defaults;
 }
 
-static int __init de_init_one (struct pci_dev *pdev,
+static int __devinit de_init_one (struct pci_dev *pdev,
                                  const struct pci_device_id *ent)
 {
        struct net_device *dev;
@@ -2083,7 +2082,7 @@ err_out_free:
        return rc;
 }
 
-static void __exit de_remove_one (struct pci_dev *pdev)
+static void __devexit de_remove_one (struct pci_dev *pdev)
 {
        struct net_device *dev = pci_get_drvdata(pdev);
        struct de_private *de = dev->priv;
@@ -2139,17 +2138,21 @@ static int de_resume (struct pci_dev *pdev)
 {
        struct net_device *dev = pci_get_drvdata (pdev);
        struct de_private *de = dev->priv;
+       int retval = 0;
 
        rtnl_lock();
        if (netif_device_present(dev))
                goto out;
-       if (netif_running(dev)) {
-               pci_enable_device(pdev);
-               de_init_hw(de);
-               netif_device_attach(dev);
-       } else {
-               netif_device_attach(dev);
+       if (!netif_running(dev))
+               goto out_attach;
+       if ((retval = pci_enable_device(pdev))) {
+               printk (KERN_ERR "%s: pci_enable_device failed in resume\n",
+                       dev->name);
+               goto out;
        }
+       de_init_hw(de);
+out_attach:
+       netif_device_attach(dev);
 out:
        rtnl_unlock();
        return 0;
@@ -2161,7 +2164,7 @@ static struct pci_driver de_driver = {
        .name           = DRV_NAME,
        .id_table       = de_pci_tbl,
        .probe          = de_init_one,
-       .remove         = __exit_p(de_remove_one),
+       .remove         = __devexit_p(de_remove_one),
 #ifdef CONFIG_PM
        .suspend        = de_suspend,
        .resume         = de_resume,
@@ -2173,7 +2176,7 @@ static int __init de_init (void)
 #ifdef MODULE
        printk("%s", version);
 #endif
-       return pci_module_init (&de_driver);
+       return pci_register_driver(&de_driver);
 }
 
 static void __exit de_exit (void)