Merge ../linux-2.6-watchdog-mm
[linux-drm-fsl-dcu.git] / drivers / char / rio / rio_linux.c
index 3bea594600d46162cff00c6ad640a1908bdd93f6..7ac68cb3beddfa61df80e8ca0cfb22a3b53cf70b 100644 (file)
@@ -368,7 +368,7 @@ static irqreturn_t rio_interrupt(int irq, void *ptr)
        struct Host *HostP;
        func_enter();
 
-       HostP = (struct Host *) ptr;    /* &p->RIOHosts[(long)ptr]; */
+       HostP = ptr;                    /* &p->RIOHosts[(long)ptr]; */
        rio_dprintk(RIO_DEBUG_IFLOW, "rio: enter rio_interrupt (%d/%d)\n", irq, HostP->Ivec);
 
        /* AAargh! The order in which to do these things is essential and
@@ -402,7 +402,7 @@ static irqreturn_t rio_interrupt(int irq, void *ptr)
                return IRQ_HANDLED;
        }
 
-       RIOServiceHost(p, HostP, irq);
+       RIOServiceHost(p, HostP);
 
        rio_dprintk(RIO_DEBUG_IFLOW, "riointr() doing host %p type %d\n", ptr, HostP->Type);
 
@@ -1017,6 +1017,10 @@ static int __init rio_init(void)
                        rio_dprintk(RIO_DEBUG_PROBE, "Hmm Tested ok, uniqid = %x.\n", p->RIOHosts[p->RIONumHosts].UniqueNum);
 
                        fix_rio_pci(pdev);
+
+                       p->RIOHosts[p->RIONumHosts].pdev = pdev;
+                       pci_dev_get(pdev);
+
                        p->RIOLastPCISearch = 0;
                        p->RIONumHosts++;
                        found++;
@@ -1066,6 +1070,9 @@ static int __init rio_init(void)
                            ((readb(&p->RIOHosts[p->RIONumHosts].Unique[1]) & 0xFF) << 8) | ((readb(&p->RIOHosts[p->RIONumHosts].Unique[2]) & 0xFF) << 16) | ((readb(&p->RIOHosts[p->RIONumHosts].Unique[3]) & 0xFF) << 24);
                        rio_dprintk(RIO_DEBUG_PROBE, "Hmm Tested ok, uniqid = %x.\n", p->RIOHosts[p->RIONumHosts].UniqueNum);
 
+                       p->RIOHosts[p->RIONumHosts].pdev = pdev;
+                       pci_dev_get(pdev);
+
                        p->RIOLastPCISearch = 0;
                        p->RIONumHosts++;
                        found++;
@@ -1181,6 +1188,8 @@ static void __exit rio_exit(void)
                }
                /* It is safe/allowed to del_timer a non-active timer */
                del_timer(&hp->timer);
+               if (hp->Type == RIO_PCI)
+                       pci_dev_put(hp->pdev);
        }
 
        if (misc_deregister(&rio_fw_device) < 0) {