diff options
author | Dave Jones <davej@redhat.com> | 2006-12-12 18:13:32 -0500 |
---|---|---|
committer | Dave Jones <davej@redhat.com> | 2006-12-12 18:13:32 -0500 |
commit | f0eef25339f92f7cd4aeea23d9ae97987a5a1e82 (patch) | |
tree | 2472e94d39f43a9580a6d2d5d92de0b749023263 /drivers/char/rio/rio_linux.c | |
parent | 0cfea5dd98205f2fa318836da664a7d7df1afbc1 (diff) | |
parent | e1036502e5263851259d147771226161e5ccc85a (diff) |
Merge ../linus
Diffstat (limited to 'drivers/char/rio/rio_linux.c')
-rw-r--r-- | drivers/char/rio/rio_linux.c | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/drivers/char/rio/rio_linux.c b/drivers/char/rio/rio_linux.c index 3fa80aaf4527..e79b2ede8510 100644 --- a/drivers/char/rio/rio_linux.c +++ b/drivers/char/rio/rio_linux.c | |||
@@ -363,12 +363,12 @@ static void rio_reset_interrupt(struct Host *HostP) | |||
363 | } | 363 | } |
364 | 364 | ||
365 | 365 | ||
366 | static irqreturn_t rio_interrupt(int irq, void *ptr, struct pt_regs *regs) | 366 | static irqreturn_t rio_interrupt(int irq, void *ptr) |
367 | { | 367 | { |
368 | struct Host *HostP; | 368 | struct Host *HostP; |
369 | func_enter(); | 369 | func_enter(); |
370 | 370 | ||
371 | HostP = (struct Host *) ptr; /* &p->RIOHosts[(long)ptr]; */ | 371 | HostP = ptr; /* &p->RIOHosts[(long)ptr]; */ |
372 | rio_dprintk(RIO_DEBUG_IFLOW, "rio: enter rio_interrupt (%d/%d)\n", irq, HostP->Ivec); | 372 | rio_dprintk(RIO_DEBUG_IFLOW, "rio: enter rio_interrupt (%d/%d)\n", irq, HostP->Ivec); |
373 | 373 | ||
374 | /* AAargh! The order in which to do these things is essential and | 374 | /* 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, struct pt_regs *regs) | |||
402 | return IRQ_HANDLED; | 402 | return IRQ_HANDLED; |
403 | } | 403 | } |
404 | 404 | ||
405 | RIOServiceHost(p, HostP, irq); | 405 | RIOServiceHost(p, HostP); |
406 | 406 | ||
407 | rio_dprintk(RIO_DEBUG_IFLOW, "riointr() doing host %p type %d\n", ptr, HostP->Type); | 407 | rio_dprintk(RIO_DEBUG_IFLOW, "riointr() doing host %p type %d\n", ptr, HostP->Type); |
408 | 408 | ||
@@ -417,7 +417,7 @@ static void rio_pollfunc(unsigned long data) | |||
417 | { | 417 | { |
418 | func_enter(); | 418 | func_enter(); |
419 | 419 | ||
420 | rio_interrupt(0, &p->RIOHosts[data], NULL); | 420 | rio_interrupt(0, &p->RIOHosts[data]); |
421 | p->RIOHosts[data].timer.expires = jiffies + rio_poll; | 421 | p->RIOHosts[data].timer.expires = jiffies + rio_poll; |
422 | add_timer(&p->RIOHosts[data].timer); | 422 | add_timer(&p->RIOHosts[data].timer); |
423 | 423 | ||
@@ -727,7 +727,7 @@ static struct vpd_prom *get_VPD_PROM(struct Host *hp) | |||
727 | return &vpdp; | 727 | return &vpdp; |
728 | } | 728 | } |
729 | 729 | ||
730 | static struct tty_operations rio_ops = { | 730 | static const struct tty_operations rio_ops = { |
731 | .open = riotopen, | 731 | .open = riotopen, |
732 | .close = gs_close, | 732 | .close = gs_close, |
733 | .write = gs_write, | 733 | .write = gs_write, |
@@ -1017,11 +1017,16 @@ static int __init rio_init(void) | |||
1017 | rio_dprintk(RIO_DEBUG_PROBE, "Hmm Tested ok, uniqid = %x.\n", p->RIOHosts[p->RIONumHosts].UniqueNum); | 1017 | rio_dprintk(RIO_DEBUG_PROBE, "Hmm Tested ok, uniqid = %x.\n", p->RIOHosts[p->RIONumHosts].UniqueNum); |
1018 | 1018 | ||
1019 | fix_rio_pci(pdev); | 1019 | fix_rio_pci(pdev); |
1020 | |||
1021 | p->RIOHosts[p->RIONumHosts].pdev = pdev; | ||
1022 | pci_dev_get(pdev); | ||
1023 | |||
1020 | p->RIOLastPCISearch = 0; | 1024 | p->RIOLastPCISearch = 0; |
1021 | p->RIONumHosts++; | 1025 | p->RIONumHosts++; |
1022 | found++; | 1026 | found++; |
1023 | } else { | 1027 | } else { |
1024 | iounmap(p->RIOHosts[p->RIONumHosts].Caddr); | 1028 | iounmap(p->RIOHosts[p->RIONumHosts].Caddr); |
1029 | p->RIOHosts[p->RIONumHosts].Caddr = NULL; | ||
1025 | } | 1030 | } |
1026 | } | 1031 | } |
1027 | 1032 | ||
@@ -1066,11 +1071,15 @@ static int __init rio_init(void) | |||
1066 | ((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); | 1071 | ((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); |
1067 | rio_dprintk(RIO_DEBUG_PROBE, "Hmm Tested ok, uniqid = %x.\n", p->RIOHosts[p->RIONumHosts].UniqueNum); | 1072 | rio_dprintk(RIO_DEBUG_PROBE, "Hmm Tested ok, uniqid = %x.\n", p->RIOHosts[p->RIONumHosts].UniqueNum); |
1068 | 1073 | ||
1074 | p->RIOHosts[p->RIONumHosts].pdev = pdev; | ||
1075 | pci_dev_get(pdev); | ||
1076 | |||
1069 | p->RIOLastPCISearch = 0; | 1077 | p->RIOLastPCISearch = 0; |
1070 | p->RIONumHosts++; | 1078 | p->RIONumHosts++; |
1071 | found++; | 1079 | found++; |
1072 | } else { | 1080 | } else { |
1073 | iounmap(p->RIOHosts[p->RIONumHosts].Caddr); | 1081 | iounmap(p->RIOHosts[p->RIONumHosts].Caddr); |
1082 | p->RIOHosts[p->RIONumHosts].Caddr = NULL; | ||
1074 | } | 1083 | } |
1075 | #else | 1084 | #else |
1076 | printk(KERN_ERR "Found an older RIO PCI card, but the driver is not " "compiled to support it.\n"); | 1085 | printk(KERN_ERR "Found an older RIO PCI card, but the driver is not " "compiled to support it.\n"); |
@@ -1110,8 +1119,10 @@ static int __init rio_init(void) | |||
1110 | } | 1119 | } |
1111 | } | 1120 | } |
1112 | 1121 | ||
1113 | if (!okboard) | 1122 | if (!okboard) { |
1114 | iounmap(hp->Caddr); | 1123 | iounmap(hp->Caddr); |
1124 | hp->Caddr = NULL; | ||
1125 | } | ||
1115 | } | 1126 | } |
1116 | } | 1127 | } |
1117 | 1128 | ||
@@ -1181,6 +1192,10 @@ static void __exit rio_exit(void) | |||
1181 | } | 1192 | } |
1182 | /* It is safe/allowed to del_timer a non-active timer */ | 1193 | /* It is safe/allowed to del_timer a non-active timer */ |
1183 | del_timer(&hp->timer); | 1194 | del_timer(&hp->timer); |
1195 | if (hp->Caddr) | ||
1196 | iounmap(hp->Caddr); | ||
1197 | if (hp->Type == RIO_PCI) | ||
1198 | pci_dev_put(hp->pdev); | ||
1184 | } | 1199 | } |
1185 | 1200 | ||
1186 | if (misc_deregister(&rio_fw_device) < 0) { | 1201 | if (misc_deregister(&rio_fw_device) < 0) { |