IRQ: Maintain regs pointer globally rather than passing to IRQ handlers
[safe/jmp/linux-2.6] / drivers / net / irda / vlsi_ir.c
index 4be9539..18c6819 100644 (file)
@@ -21,7 +21,6 @@
  *
  ********************************************************************/
 
-#include <linux/config.h>
 #include <linux/module.h>
  
 #define DRIVER_NAME            "vlsi_ir"
@@ -473,8 +472,7 @@ static int vlsi_free_ring(struct vlsi_ring *r)
                rd_set_addr_status(rd, 0, 0);
                if (busaddr)
                        pci_unmap_single(r->pdev, busaddr, r->len, r->dir);
-               if (rd->buf)
-                       kfree(rd->buf);
+               kfree(rd->buf);
        }
        kfree(r);
        return 0;
@@ -960,7 +958,7 @@ static int vlsi_hard_start_xmit(struct sk_buff *skb, struct net_device *ndev)
                            ||  (now.tv_sec==ready.tv_sec && now.tv_usec>=ready.tv_usec))
                                break;
                        udelay(100);
-                       /* must not sleep here - we are called under xmit_lock! */
+                       /* must not sleep here - called under netif_tx_lock! */
                }
        }
 
@@ -1457,8 +1455,7 @@ static int vlsi_ioctl(struct net_device *ndev, struct ifreq *rq, int cmd)
 
 /********************************************************/
 
-static irqreturn_t vlsi_interrupt(int irq, void *dev_instance,
-                                       struct pt_regs *regs)
+static irqreturn_t vlsi_interrupt(int irq, void *dev_instance)
 {
        struct net_device *ndev = dev_instance;
        vlsi_irda_dev_t *idev = ndev->priv;
@@ -1519,7 +1516,7 @@ static int vlsi_open(struct net_device *ndev)
 
        outb(IRINTR_INT_MASK, ndev->base_addr+VLSI_PIO_IRINTR);
 
-       if (request_irq(ndev->irq, vlsi_interrupt, SA_SHIRQ,
+       if (request_irq(ndev->irq, vlsi_interrupt, IRQF_SHARED,
                        drivername, ndev)) {
                IRDA_WARNING("%s: couldn't get IRQ: %d\n",
                             __FUNCTION__, ndev->irq);
@@ -1757,12 +1754,12 @@ static int vlsi_irda_suspend(struct pci_dev *pdev, pm_message_t state)
        idev = ndev->priv;      
        down(&idev->sem);
        if (pdev->current_state != 0) {                 /* already suspended */
-               if (state > pdev->current_state) {      /* simply go deeper */
-                       pci_set_power_state(pdev,state);
-                       pdev->current_state = state;
+               if (state.event > pdev->current_state) {        /* simply go deeper */
+                       pci_set_power_state(pdev, pci_choose_state(pdev, state));
+                       pdev->current_state = state.event;
                }
                else
-                       IRDA_ERROR("%s - %s: invalid suspend request %u -> %u\n", __FUNCTION__, PCIDEV_NAME(pdev), pdev->current_state, state);
+                       IRDA_ERROR("%s - %s: invalid suspend request %u -> %u\n", __FUNCTION__, PCIDEV_NAME(pdev), pdev->current_state, state.event);
                up(&idev->sem);
                return 0;
        }
@@ -1777,7 +1774,7 @@ static int vlsi_irda_suspend(struct pci_dev *pdev, pm_message_t state)
        }
 
        pci_set_power_state(pdev, pci_choose_state(pdev, state));
-       pdev->current_state = state;
+       pdev->current_state = state.event;
        idev->resume_ok = 1;
        up(&idev->sem);
        return 0;
@@ -1875,11 +1872,11 @@ static int __init vlsi_mod_init(void)
 
        sirpulse = !!sirpulse;
 
-       /* create_proc_entry returns NULL if !CONFIG_PROC_FS.
+       /* proc_mkdir returns NULL if !CONFIG_PROC_FS.
         * Failure to create the procfs entry is handled like running
         * without procfs - it's not required for the driver to work.
         */
-       vlsi_proc_root = create_proc_entry(PROC_DIR, S_IFDIR, NULL);
+       vlsi_proc_root = proc_mkdir(PROC_DIR, NULL);
        if (vlsi_proc_root) {
                /* protect registered procdir against module removal.
                 * Because we are in the module init path there's no race
@@ -1888,7 +1885,7 @@ static int __init vlsi_mod_init(void)
                vlsi_proc_root->owner = THIS_MODULE;
        }
 
-       ret = pci_module_init(&vlsi_irda_driver);
+       ret = pci_register_driver(&vlsi_irda_driver);
 
        if (ret && vlsi_proc_root)
                remove_proc_entry(PROC_DIR, NULL);