diff options
author | Alan Cox <alan@lxorguk.ukuu.org.uk> | 2006-10-01 02:27:29 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-10-01 03:39:20 -0400 |
commit | 970a61363be4a6633de0fbbe6fe3a249238c4acc (patch) | |
tree | 198c15246e805853fef4f63d859e308411f152b4 /drivers | |
parent | 1424e5044882f92b8c51540033b229723e1f2651 (diff) |
[PATCH] serverworks: Switch to pci refcounted interfaces
As we don't support hotplug we end up leaking an isa_dev reference which if
unload was ever added we would drop at the end of unloading. This is fine
because we do genuinely need the isa_dev pointer until unload.
Signed-off-by: Alan Cox <alan@redhat.com>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/ide/pci/serverworks.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/ide/pci/serverworks.c b/drivers/ide/pci/serverworks.c index f063d954236c..057548d07205 100644 --- a/drivers/ide/pci/serverworks.c +++ b/drivers/ide/pci/serverworks.c | |||
@@ -359,7 +359,7 @@ static unsigned int __devinit init_chipset_svwks (struct pci_dev *dev, const cha | |||
359 | 359 | ||
360 | /* OSB4 : South Bridge and IDE */ | 360 | /* OSB4 : South Bridge and IDE */ |
361 | if (dev->device == PCI_DEVICE_ID_SERVERWORKS_OSB4IDE) { | 361 | if (dev->device == PCI_DEVICE_ID_SERVERWORKS_OSB4IDE) { |
362 | isa_dev = pci_find_device(PCI_VENDOR_ID_SERVERWORKS, | 362 | isa_dev = pci_get_device(PCI_VENDOR_ID_SERVERWORKS, |
363 | PCI_DEVICE_ID_SERVERWORKS_OSB4, NULL); | 363 | PCI_DEVICE_ID_SERVERWORKS_OSB4, NULL); |
364 | if (isa_dev) { | 364 | if (isa_dev) { |
365 | pci_read_config_dword(isa_dev, 0x64, ®); | 365 | pci_read_config_dword(isa_dev, 0x64, ®); |
@@ -380,7 +380,7 @@ static unsigned int __devinit init_chipset_svwks (struct pci_dev *dev, const cha | |||
380 | if (!(PCI_FUNC(dev->devfn) & 1)) { | 380 | if (!(PCI_FUNC(dev->devfn) & 1)) { |
381 | struct pci_dev * findev = NULL; | 381 | struct pci_dev * findev = NULL; |
382 | u32 reg4c = 0; | 382 | u32 reg4c = 0; |
383 | findev = pci_find_device(PCI_VENDOR_ID_SERVERWORKS, | 383 | findev = pci_get_device(PCI_VENDOR_ID_SERVERWORKS, |
384 | PCI_DEVICE_ID_SERVERWORKS_CSB5, NULL); | 384 | PCI_DEVICE_ID_SERVERWORKS_CSB5, NULL); |
385 | if (findev) { | 385 | if (findev) { |
386 | pci_read_config_dword(findev, 0x4C, ®4c); | 386 | pci_read_config_dword(findev, 0x4C, ®4c); |
@@ -388,6 +388,7 @@ static unsigned int __devinit init_chipset_svwks (struct pci_dev *dev, const cha | |||
388 | reg4c |= 0x00000040; | 388 | reg4c |= 0x00000040; |
389 | reg4c |= 0x00000020; | 389 | reg4c |= 0x00000020; |
390 | pci_write_config_dword(findev, 0x4C, reg4c); | 390 | pci_write_config_dword(findev, 0x4C, reg4c); |
391 | pci_dev_put(findev); | ||
391 | } | 392 | } |
392 | outb_p(0x06, 0x0c00); | 393 | outb_p(0x06, 0x0c00); |
393 | dev->irq = inb_p(0x0c01); | 394 | dev->irq = inb_p(0x0c01); |
@@ -395,12 +396,13 @@ static unsigned int __devinit init_chipset_svwks (struct pci_dev *dev, const cha | |||
395 | struct pci_dev * findev = NULL; | 396 | struct pci_dev * findev = NULL; |
396 | u8 reg41 = 0; | 397 | u8 reg41 = 0; |
397 | 398 | ||
398 | findev = pci_find_device(PCI_VENDOR_ID_SERVERWORKS, | 399 | findev = pci_get_device(PCI_VENDOR_ID_SERVERWORKS, |
399 | PCI_DEVICE_ID_SERVERWORKS_CSB6, NULL); | 400 | PCI_DEVICE_ID_SERVERWORKS_CSB6, NULL); |
400 | if (findev) { | 401 | if (findev) { |
401 | pci_read_config_byte(findev, 0x41, ®41); | 402 | pci_read_config_byte(findev, 0x41, ®41); |
402 | reg41 &= ~0x40; | 403 | reg41 &= ~0x40; |
403 | pci_write_config_byte(findev, 0x41, reg41); | 404 | pci_write_config_byte(findev, 0x41, reg41); |
405 | pci_dev_put(findev); | ||
404 | } | 406 | } |
405 | /* | 407 | /* |
406 | * This is a device pin issue on CSB6. | 408 | * This is a device pin issue on CSB6. |