aboutsummaryrefslogtreecommitdiffstats
path: root/arch/alpha/kernel/sys_miata.c
diff options
context:
space:
mode:
authorAlan Cox <alan@lxorguk.ukuu.org.uk>2006-12-06 23:33:59 -0500
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-07 11:39:26 -0500
commit074cec54d1049ab580ecd0026623b553e0e270c4 (patch)
tree46de20e33bee156e7edb948b1d8acbf46c67c80a /arch/alpha/kernel/sys_miata.c
parent3869aa292fbd24103b8338937cb351459efe3f82 (diff)
[PATCH] alpha: switch to pci_get API
Now that we have pci_get_bus_and_slot we can do the job correctly. Note that some of these calls intentionally leak a device - this is because the device in question is always needed from boot to reboot. Signed-off-by: Alan Cox <alan@redhat.com> Cc: Richard Henderson <rth@twiddle.net> Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/alpha/kernel/sys_miata.c')
-rw-r--r--arch/alpha/kernel/sys_miata.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/arch/alpha/kernel/sys_miata.c b/arch/alpha/kernel/sys_miata.c
index b8b817feb1ee..910b43cd63e8 100644
--- a/arch/alpha/kernel/sys_miata.c
+++ b/arch/alpha/kernel/sys_miata.c
@@ -183,11 +183,15 @@ miata_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
183 183
184 if((slot == 7) && (PCI_FUNC(dev->devfn) == 3)) { 184 if((slot == 7) && (PCI_FUNC(dev->devfn) == 3)) {
185 u8 irq=0; 185 u8 irq=0;
186 186 struct pci_dev *pdev = pci_get_slot(dev->bus, dev->devfn & ~7);
187 if(pci_read_config_byte(pci_find_slot(dev->bus->number, dev->devfn & ~(7)), 0x40,&irq)!=PCIBIOS_SUCCESSFUL) 187 if(pdev == NULL || pci_read_config_byte(pdev, 0x40,&irq) != PCIBIOS_SUCCESSFUL) {
188 pci_dev_put(pdev);
188 return -1; 189 return -1;
189 else 190 }
191 else {
192 pci_dev_put(pdev);
190 return irq; 193 return irq;
194 }
191 } 195 }
192 196
193 return COMMON_TABLE_LOOKUP; 197 return COMMON_TABLE_LOOKUP;