]> err.no Git - linux-2.6/blobdiff - drivers/net/tulip/winbond-840.c
drivers/net: Remove deprecated use of pci_module_init()
[linux-2.6] / drivers / net / tulip / winbond-840.c
index 8fea2aa455d4690a10763f7a4dc070c755a9c3d0..6b82d1498223d300d1b83a3a1abf005e4e693f5e 100644 (file)
@@ -138,7 +138,7 @@ static int full_duplex[MAX_UNITS] = {-1, -1, -1, -1, -1, -1, -1, -1};
 #include <asm/irq.h>
 
 /* These identify the driver base version and may not be removed. */
-static char version[] __devinitdata =
+static char version[] =
 KERN_INFO DRV_NAME ".c:v" DRV_VERSION " (2.4 port) " DRV_RELDATE "  Donald Becker <becker@scyld.com>\n"
 KERN_INFO "  http://www.scyld.com/network/drivers.html\n";
 
@@ -212,48 +212,33 @@ Test with 'ping -s 10000' on a fast computer.
 /*
   PCI probe table.
 */
-enum pci_id_flags_bits {
-        /* Set PCI command register bits before calling probe1(). */
-        PCI_USES_IO=1, PCI_USES_MEM=2, PCI_USES_MASTER=4,
-        /* Read and map the single following PCI BAR. */
-        PCI_ADDR0=0<<4, PCI_ADDR1=1<<4, PCI_ADDR2=2<<4, PCI_ADDR3=3<<4,
-        PCI_ADDR_64BITS=0x100, PCI_NO_ACPI_WAKE=0x200, PCI_NO_MIN_LATENCY=0x400,
-};
 enum chip_capability_flags {
-       CanHaveMII=1, HasBrokenTx=2, AlwaysFDX=4, FDXOnNoMII=8,};
-#ifdef USE_IO_OPS
-#define W840_FLAGS (PCI_USES_IO | PCI_ADDR0 | PCI_USES_MASTER)
-#else
-#define W840_FLAGS (PCI_USES_MEM | PCI_ADDR1 | PCI_USES_MASTER)
-#endif
+       CanHaveMII=1, HasBrokenTx=2, AlwaysFDX=4, FDXOnNoMII=8,
+};
 
-static struct pci_device_id w840_pci_tbl[] = {
+static const struct pci_device_id w840_pci_tbl[] = {
        { 0x1050, 0x0840, PCI_ANY_ID, 0x8153,     0, 0, 0 },
        { 0x1050, 0x0840, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1 },
        { 0x11f6, 0x2011, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 2 },
-       { 0, }
+       { }
 };
 MODULE_DEVICE_TABLE(pci, w840_pci_tbl);
 
+enum {
+       netdev_res_size         = 128,  /* size of PCI BAR resource */
+};
+
 struct pci_id_info {
         const char *name;
-        struct match_info {
-                int     pci, pci_mask, subsystem, subsystem_mask;
-                int revision, revision_mask;                            /* Only 8 bits. */
-        } id;
-        enum pci_id_flags_bits pci_flags;
-        int io_size;                            /* Needed for I/O region check or ioremap(). */
-        int drv_flags;                          /* Driver use, intended as capability flags. */
+        int drv_flags;         /* Driver use, intended as capability flags. */
 };
-static struct pci_id_info pci_id_tbl[] = {
-       {"Winbond W89c840",                     /* Sometime a Level-One switch card. */
-        { 0x08401050, 0xffffffff, 0x81530000, 0xffff0000 },
-        W840_FLAGS, 128, CanHaveMII | HasBrokenTx | FDXOnNoMII},
-       {"Winbond W89c840", { 0x08401050, 0xffffffff, },
-        W840_FLAGS, 128, CanHaveMII | HasBrokenTx},
-       {"Compex RL100-ATX", { 0x201111F6, 0xffffffff,},
-        W840_FLAGS, 128, CanHaveMII | HasBrokenTx},
-       {NULL,},                                        /* 0 terminated list. */
+
+static const struct pci_id_info pci_id_tbl[] __devinitdata = {
+       {                               /* Sometime a Level-One switch card. */
+         "Winbond W89c840",    CanHaveMII | HasBrokenTx | FDXOnNoMII},
+       { "Winbond W89c840",    CanHaveMII | HasBrokenTx},
+       { "Compex RL100-ATX",   CanHaveMII | HasBrokenTx},
+       { }     /* terminate list. */
 };
 
 /* This driver was written to use PCI memory space, however some x86 systems
@@ -411,7 +396,7 @@ static int __devinit w840_probe1 (struct pci_dev *pdev,
 #ifdef USE_IO_OPS
        bar = 0;
 #endif
-       ioaddr = pci_iomap(pdev, bar, pci_id_tbl[chip_idx].io_size);
+       ioaddr = pci_iomap(pdev, bar, netdev_res_size);
        if (!ioaddr)
                goto err_out_free_res;
 
@@ -670,7 +655,7 @@ static int netdev_open(struct net_device *dev)
        iowrite32(0x00000001, ioaddr + PCIBusCfg);              /* Reset */
 
        netif_device_detach(dev);
-       i = request_irq(dev->irq, &intr_handler, SA_SHIRQ, dev->name, dev);
+       i = request_irq(dev->irq, &intr_handler, IRQF_SHARED, dev->name, dev);
        if (i)
                goto out_err;
 
@@ -1704,7 +1689,7 @@ static struct pci_driver w840_driver = {
 static int __init w840_init(void)
 {
        printk(version);
-       return pci_module_init(&w840_driver);
+       return pci_register_driver(&w840_driver);
 }
 
 static void __exit w840_exit(void)