diff options
author | Alan Cox <alan@lxorguk.ukuu.org.uk> | 2006-10-03 04:14:35 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-10-03 11:04:09 -0400 |
commit | 652aa16291095911640137155063a5c6ea9bad74 (patch) | |
tree | 6c463c8da82045e9ecdbb1e7e3242c12b4be6bae /drivers/ide/pci/cs5530.c | |
parent | a4bea10eca68152e84ffc4eaeb9d20ec2ac34664 (diff) |
[PATCH] IDE: more pci_find cleanup
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/ide/pci/cs5530.c')
-rw-r--r-- | drivers/ide/pci/cs5530.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/ide/pci/cs5530.c b/drivers/ide/pci/cs5530.c index 380bb28c7c54..ae405fa32236 100644 --- a/drivers/ide/pci/cs5530.c +++ b/drivers/ide/pci/cs5530.c | |||
@@ -222,23 +222,23 @@ static unsigned int __devinit init_chipset_cs5530 (struct pci_dev *dev, const ch | |||
222 | unsigned long flags; | 222 | unsigned long flags; |
223 | 223 | ||
224 | dev = NULL; | 224 | dev = NULL; |
225 | while ((dev = pci_find_device(PCI_VENDOR_ID_CYRIX, PCI_ANY_ID, dev)) != NULL) { | 225 | while ((dev = pci_get_device(PCI_VENDOR_ID_CYRIX, PCI_ANY_ID, dev)) != NULL) { |
226 | switch (dev->device) { | 226 | switch (dev->device) { |
227 | case PCI_DEVICE_ID_CYRIX_PCI_MASTER: | 227 | case PCI_DEVICE_ID_CYRIX_PCI_MASTER: |
228 | master_0 = dev; | 228 | master_0 = pci_dev_get(dev); |
229 | break; | 229 | break; |
230 | case PCI_DEVICE_ID_CYRIX_5530_LEGACY: | 230 | case PCI_DEVICE_ID_CYRIX_5530_LEGACY: |
231 | cs5530_0 = dev; | 231 | cs5530_0 = pci_dev_get(dev); |
232 | break; | 232 | break; |
233 | } | 233 | } |
234 | } | 234 | } |
235 | if (!master_0) { | 235 | if (!master_0) { |
236 | printk(KERN_ERR "%s: unable to locate PCI MASTER function\n", name); | 236 | printk(KERN_ERR "%s: unable to locate PCI MASTER function\n", name); |
237 | return 0; | 237 | goto out; |
238 | } | 238 | } |
239 | if (!cs5530_0) { | 239 | if (!cs5530_0) { |
240 | printk(KERN_ERR "%s: unable to locate CS5530 LEGACY function\n", name); | 240 | printk(KERN_ERR "%s: unable to locate CS5530 LEGACY function\n", name); |
241 | return 0; | 241 | goto out; |
242 | } | 242 | } |
243 | 243 | ||
244 | spin_lock_irqsave(&ide_lock, flags); | 244 | spin_lock_irqsave(&ide_lock, flags); |
@@ -296,6 +296,9 @@ static unsigned int __devinit init_chipset_cs5530 (struct pci_dev *dev, const ch | |||
296 | 296 | ||
297 | spin_unlock_irqrestore(&ide_lock, flags); | 297 | spin_unlock_irqrestore(&ide_lock, flags); |
298 | 298 | ||
299 | out: | ||
300 | pci_dev_put(master_0); | ||
301 | pci_dev_put(cs5530_0); | ||
299 | return 0; | 302 | return 0; |
300 | } | 303 | } |
301 | 304 | ||