diff options
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 | ||