aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/ide/pci/alim15x3.c16
-rw-r--r--drivers/ide/pci/pdc202xx_new.c7
-rw-r--r--drivers/ide/pci/sis5513.c3
-rw-r--r--include/asm-i386/ide.h4
4 files changed, 18 insertions, 12 deletions
diff --git a/drivers/ide/pci/alim15x3.c b/drivers/ide/pci/alim15x3.c
index d419e4bb54f4..89109be5162c 100644
--- a/drivers/ide/pci/alim15x3.c
+++ b/drivers/ide/pci/alim15x3.c
@@ -586,11 +586,11 @@ static unsigned int __devinit init_chipset_ali15x3 (struct pci_dev *dev, const c
586{ 586{
587 unsigned long flags; 587 unsigned long flags;
588 u8 tmpbyte; 588 u8 tmpbyte;
589 struct pci_dev *north = pci_find_slot(0, PCI_DEVFN(0,0)); 589 struct pci_dev *north = pci_get_slot(dev->bus, PCI_DEVFN(0,0));
590 590
591 pci_read_config_byte(dev, PCI_REVISION_ID, &m5229_revision); 591 pci_read_config_byte(dev, PCI_REVISION_ID, &m5229_revision);
592 592
593 isa_dev = pci_find_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1533, NULL); 593 isa_dev = pci_get_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1533, NULL);
594 594
595#if defined(DISPLAY_ALI_TIMINGS) && defined(CONFIG_PROC_FS) 595#if defined(DISPLAY_ALI_TIMINGS) && defined(CONFIG_PROC_FS)
596 if (!ali_proc) { 596 if (!ali_proc) {
@@ -613,8 +613,7 @@ static unsigned int __devinit init_chipset_ali15x3 (struct pci_dev *dev, const c
613 * clear bit 7 613 * clear bit 7
614 */ 614 */
615 pci_write_config_byte(dev, 0x4b, tmpbyte & 0x7F); 615 pci_write_config_byte(dev, 0x4b, tmpbyte & 0x7F);
616 local_irq_restore(flags); 616 goto out;
617 return 0;
618 } 617 }
619 618
620 /* 619 /*
@@ -637,10 +636,8 @@ static unsigned int __devinit init_chipset_ali15x3 (struct pci_dev *dev, const c
637 * box without a device at 0:0.0. The ALi bridge will be at 636 * box without a device at 0:0.0. The ALi bridge will be at
638 * 0:0.0 so if we didn't find one we know what is cooking. 637 * 0:0.0 so if we didn't find one we know what is cooking.
639 */ 638 */
640 if (north && north->vendor != PCI_VENDOR_ID_AL) { 639 if (north && north->vendor != PCI_VENDOR_ID_AL)
641 local_irq_restore(flags); 640 goto out;
642 return 0;
643 }
644 641
645 if (m5229_revision < 0xC5 && isa_dev) 642 if (m5229_revision < 0xC5 && isa_dev)
646 { 643 {
@@ -661,6 +658,9 @@ static unsigned int __devinit init_chipset_ali15x3 (struct pci_dev *dev, const c
661 pci_write_config_byte(isa_dev, 0x79, tmpbyte | 0x02); 658 pci_write_config_byte(isa_dev, 0x79, tmpbyte | 0x02);
662 } 659 }
663 } 660 }
661out:
662 pci_dev_put(north);
663 pci_dev_put(isa_dev);
664 local_irq_restore(flags); 664 local_irq_restore(flags);
665 return 0; 665 return 0;
666} 666}
diff --git a/drivers/ide/pci/pdc202xx_new.c b/drivers/ide/pci/pdc202xx_new.c
index 6c097e80b4df..0592dc0f96c0 100644
--- a/drivers/ide/pci/pdc202xx_new.c
+++ b/drivers/ide/pci/pdc202xx_new.c
@@ -362,6 +362,7 @@ static int __devinit init_setup_pdc20270(struct pci_dev *dev,
362 ide_pci_device_t *d) 362 ide_pci_device_t *d)
363{ 363{
364 struct pci_dev *findev = NULL; 364 struct pci_dev *findev = NULL;
365 int ret;
365 366
366 if ((dev->bus->self && 367 if ((dev->bus->self &&
367 dev->bus->self->vendor == PCI_VENDOR_ID_DEC) && 368 dev->bus->self->vendor == PCI_VENDOR_ID_DEC) &&
@@ -369,14 +370,16 @@ static int __devinit init_setup_pdc20270(struct pci_dev *dev,
369 if (PCI_SLOT(dev->devfn) & 2) 370 if (PCI_SLOT(dev->devfn) & 2)
370 return -ENODEV; 371 return -ENODEV;
371 d->extra = 0; 372 d->extra = 0;
372 while ((findev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, findev)) != NULL) { 373 while ((findev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, findev)) != NULL) {
373 if ((findev->vendor == dev->vendor) && 374 if ((findev->vendor == dev->vendor) &&
374 (findev->device == dev->device) && 375 (findev->device == dev->device) &&
375 (PCI_SLOT(findev->devfn) & 2)) { 376 (PCI_SLOT(findev->devfn) & 2)) {
376 if (findev->irq != dev->irq) { 377 if (findev->irq != dev->irq) {
377 findev->irq = dev->irq; 378 findev->irq = dev->irq;
378 } 379 }
379 return ide_setup_pci_devices(dev, findev, d); 380 ret = ide_setup_pci_devices(dev, findev, d);
381 pci_dev_put(findev);
382 return ret;
380 } 383 }
381 } 384 }
382 } 385 }
diff --git a/drivers/ide/pci/sis5513.c b/drivers/ide/pci/sis5513.c
index 92edf76bd7ad..6b313139b5e4 100644
--- a/drivers/ide/pci/sis5513.c
+++ b/drivers/ide/pci/sis5513.c
@@ -800,9 +800,10 @@ static unsigned int __devinit init_chipset_sis5513 (struct pci_dev *dev, const c
800 800
801 if (trueid == 0x5517) { /* SiS 961/961B */ 801 if (trueid == 0x5517) { /* SiS 961/961B */
802 802
803 lpc_bridge = pci_find_slot(0x00, 0x10); /* Bus 0, Dev 2, Fn 0 */ 803 lpc_bridge = pci_get_slot(dev->bus, 0x10); /* Bus 0, Dev 2, Fn 0 */
804 pci_read_config_byte(lpc_bridge, PCI_REVISION_ID, &sbrev); 804 pci_read_config_byte(lpc_bridge, PCI_REVISION_ID, &sbrev);
805 pci_read_config_byte(dev, 0x49, &prefctl); 805 pci_read_config_byte(dev, 0x49, &prefctl);
806 pci_dev_put(lpc_bridge);
806 807
807 if (sbrev == 0x10 && (prefctl & 0x80)) { 808 if (sbrev == 0x10 && (prefctl & 0x80)) {
808 printk(KERN_INFO "SIS5513: SiS 961B MuTIOL IDE UDMA133 controller\n"); 809 printk(KERN_INFO "SIS5513: SiS 961B MuTIOL IDE UDMA133 controller\n");
diff --git a/include/asm-i386/ide.h b/include/asm-i386/ide.h
index 73465d2892b9..0fc240c80f49 100644
--- a/include/asm-i386/ide.h
+++ b/include/asm-i386/ide.h
@@ -40,13 +40,14 @@ static __inline__ int ide_default_irq(unsigned long base)
40 40
41static __inline__ unsigned long ide_default_io_base(int index) 41static __inline__ unsigned long ide_default_io_base(int index)
42{ 42{
43 struct pci_dev *pdev;
43 /* 44 /*
44 * If PCI is present then it is not safe to poke around 45 * If PCI is present then it is not safe to poke around
45 * the other legacy IDE ports. Only 0x1f0 and 0x170 are 46 * the other legacy IDE ports. Only 0x1f0 and 0x170 are
46 * defined compatibility mode ports for PCI. A user can 47 * defined compatibility mode ports for PCI. A user can
47 * override this using ide= but we must default safe. 48 * override this using ide= but we must default safe.
48 */ 49 */
49 if (pci_find_device(PCI_ANY_ID, PCI_ANY_ID, NULL) == NULL) { 50 if ((pdev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, NULL)) == NULL) {
50 switch(index) { 51 switch(index) {
51 case 2: return 0x1e8; 52 case 2: return 0x1e8;
52 case 3: return 0x168; 53 case 3: return 0x168;
@@ -54,6 +55,7 @@ static __inline__ unsigned long ide_default_io_base(int index)
54 case 5: return 0x160; 55 case 5: return 0x160;
55 } 56 }
56 } 57 }
58 pci_dev_put(pdev);
57 switch (index) { 59 switch (index) {
58 case 0: return 0x1f0; 60 case 0: return 0x1f0;
59 case 1: return 0x170; 61 case 1: return 0x170;