diff options
author | Len Brown <len.brown@intel.com> | 2009-04-05 02:14:15 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2009-04-05 02:14:15 -0400 |
commit | 478c6a43fcbc6c11609f8cee7c7b57223907754f (patch) | |
tree | a7f7952099da60d33032aed6de9c0c56c9f8779e /drivers/ide/setup-pci.c | |
parent | 8a3f257c704e02aee9869decd069a806b45be3f1 (diff) | |
parent | 6bb597507f9839b13498781e481f5458aea33620 (diff) |
Merge branch 'linus' into release
Conflicts:
arch/x86/kernel/cpu/cpufreq/longhaul.c
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/ide/setup-pci.c')
-rw-r--r-- | drivers/ide/setup-pci.c | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/drivers/ide/setup-pci.c b/drivers/ide/setup-pci.c index e85d1ed29c2a..a19dbccd7617 100644 --- a/drivers/ide/setup-pci.c +++ b/drivers/ide/setup-pci.c | |||
@@ -305,7 +305,6 @@ static int ide_pci_check_iomem(struct pci_dev *dev, const struct ide_port_info * | |||
305 | * @dev: PCI device holding interface | 305 | * @dev: PCI device holding interface |
306 | * @d: IDE port info | 306 | * @d: IDE port info |
307 | * @port: port number | 307 | * @port: port number |
308 | * @irq: PCI IRQ | ||
309 | * @hw: hw_regs_t instance corresponding to this port | 308 | * @hw: hw_regs_t instance corresponding to this port |
310 | * | 309 | * |
311 | * Perform the initial set up for the hardware interface structure. This | 310 | * Perform the initial set up for the hardware interface structure. This |
@@ -316,7 +315,7 @@ static int ide_pci_check_iomem(struct pci_dev *dev, const struct ide_port_info * | |||
316 | */ | 315 | */ |
317 | 316 | ||
318 | static int ide_hw_configure(struct pci_dev *dev, const struct ide_port_info *d, | 317 | static int ide_hw_configure(struct pci_dev *dev, const struct ide_port_info *d, |
319 | unsigned int port, int irq, hw_regs_t *hw) | 318 | unsigned int port, hw_regs_t *hw) |
320 | { | 319 | { |
321 | unsigned long ctl = 0, base = 0; | 320 | unsigned long ctl = 0, base = 0; |
322 | 321 | ||
@@ -344,7 +343,6 @@ static int ide_hw_configure(struct pci_dev *dev, const struct ide_port_info *d, | |||
344 | } | 343 | } |
345 | 344 | ||
346 | memset(hw, 0, sizeof(*hw)); | 345 | memset(hw, 0, sizeof(*hw)); |
347 | hw->irq = irq; | ||
348 | hw->dev = &dev->dev; | 346 | hw->dev = &dev->dev; |
349 | hw->chipset = d->chipset ? d->chipset : ide_pci; | 347 | hw->chipset = d->chipset ? d->chipset : ide_pci; |
350 | ide_std_init_ports(hw, base, ctl | 2); | 348 | ide_std_init_ports(hw, base, ctl | 2); |
@@ -448,7 +446,6 @@ out: | |||
448 | * ide_pci_setup_ports - configure ports/devices on PCI IDE | 446 | * ide_pci_setup_ports - configure ports/devices on PCI IDE |
449 | * @dev: PCI device | 447 | * @dev: PCI device |
450 | * @d: IDE port info | 448 | * @d: IDE port info |
451 | * @pciirq: IRQ line | ||
452 | * @hw: hw_regs_t instances corresponding to this PCI IDE device | 449 | * @hw: hw_regs_t instances corresponding to this PCI IDE device |
453 | * @hws: hw_regs_t pointers table to update | 450 | * @hws: hw_regs_t pointers table to update |
454 | * | 451 | * |
@@ -462,7 +459,7 @@ out: | |||
462 | */ | 459 | */ |
463 | 460 | ||
464 | void ide_pci_setup_ports(struct pci_dev *dev, const struct ide_port_info *d, | 461 | void ide_pci_setup_ports(struct pci_dev *dev, const struct ide_port_info *d, |
465 | int pciirq, hw_regs_t *hw, hw_regs_t **hws) | 462 | hw_regs_t *hw, hw_regs_t **hws) |
466 | { | 463 | { |
467 | int channels = (d->host_flags & IDE_HFLAG_SINGLE) ? 1 : 2, port; | 464 | int channels = (d->host_flags & IDE_HFLAG_SINGLE) ? 1 : 2, port; |
468 | u8 tmp; | 465 | u8 tmp; |
@@ -481,7 +478,7 @@ void ide_pci_setup_ports(struct pci_dev *dev, const struct ide_port_info *d, | |||
481 | continue; /* port not enabled */ | 478 | continue; /* port not enabled */ |
482 | } | 479 | } |
483 | 480 | ||
484 | if (ide_hw_configure(dev, d, port, pciirq, hw + port)) | 481 | if (ide_hw_configure(dev, d, port, hw + port)) |
485 | continue; | 482 | continue; |
486 | 483 | ||
487 | *(hws + port) = hw + port; | 484 | *(hws + port) = hw + port; |
@@ -524,7 +521,7 @@ static int do_ide_setup_pci_device(struct pci_dev *dev, | |||
524 | if (noisy) | 521 | if (noisy) |
525 | printk(KERN_INFO "%s %s: not 100%% native mode: will " | 522 | printk(KERN_INFO "%s %s: not 100%% native mode: will " |
526 | "probe irqs later\n", d->name, pci_name(dev)); | 523 | "probe irqs later\n", d->name, pci_name(dev)); |
527 | pciirq = ret; | 524 | pciirq = 0; |
528 | } else if (!pciirq && noisy) { | 525 | } else if (!pciirq && noisy) { |
529 | printk(KERN_WARNING "%s %s: bad irq (%d): will probe later\n", | 526 | printk(KERN_WARNING "%s %s: bad irq (%d): will probe later\n", |
530 | d->name, pci_name(dev), pciirq); | 527 | d->name, pci_name(dev), pciirq); |
@@ -549,7 +546,7 @@ int ide_pci_init_one(struct pci_dev *dev, const struct ide_port_info *d, | |||
549 | if (ret < 0) | 546 | if (ret < 0) |
550 | goto out; | 547 | goto out; |
551 | 548 | ||
552 | ide_pci_setup_ports(dev, d, 0, &hw[0], &hws[0]); | 549 | ide_pci_setup_ports(dev, d, &hw[0], &hws[0]); |
553 | 550 | ||
554 | host = ide_host_alloc(d, hws); | 551 | host = ide_host_alloc(d, hws); |
555 | if (host == NULL) { | 552 | if (host == NULL) { |
@@ -561,6 +558,8 @@ int ide_pci_init_one(struct pci_dev *dev, const struct ide_port_info *d, | |||
561 | 558 | ||
562 | host->host_priv = priv; | 559 | host->host_priv = priv; |
563 | 560 | ||
561 | host->irq_flags = IRQF_SHARED; | ||
562 | |||
564 | pci_set_drvdata(dev, host); | 563 | pci_set_drvdata(dev, host); |
565 | 564 | ||
566 | ret = do_ide_setup_pci_device(dev, d, 1); | 565 | ret = do_ide_setup_pci_device(dev, d, 1); |
@@ -568,7 +567,11 @@ int ide_pci_init_one(struct pci_dev *dev, const struct ide_port_info *d, | |||
568 | goto out; | 567 | goto out; |
569 | 568 | ||
570 | /* fixup IRQ */ | 569 | /* fixup IRQ */ |
571 | hw[1].irq = hw[0].irq = ret; | 570 | if (ide_pci_is_in_compatibility_mode(dev)) { |
571 | hw[0].irq = pci_get_legacy_ide_irq(dev, 0); | ||
572 | hw[1].irq = pci_get_legacy_ide_irq(dev, 1); | ||
573 | } else | ||
574 | hw[1].irq = hw[0].irq = ret; | ||
572 | 575 | ||
573 | ret = ide_host_register(host, d, hws); | 576 | ret = ide_host_register(host, d, hws); |
574 | if (ret) | 577 | if (ret) |
@@ -591,7 +594,7 @@ int ide_pci_init_two(struct pci_dev *dev1, struct pci_dev *dev2, | |||
591 | if (ret < 0) | 594 | if (ret < 0) |
592 | goto out; | 595 | goto out; |
593 | 596 | ||
594 | ide_pci_setup_ports(pdev[i], d, 0, &hw[i*2], &hws[i*2]); | 597 | ide_pci_setup_ports(pdev[i], d, &hw[i*2], &hws[i*2]); |
595 | } | 598 | } |
596 | 599 | ||
597 | host = ide_host_alloc(d, hws); | 600 | host = ide_host_alloc(d, hws); |
@@ -605,6 +608,8 @@ int ide_pci_init_two(struct pci_dev *dev1, struct pci_dev *dev2, | |||
605 | 608 | ||
606 | host->host_priv = priv; | 609 | host->host_priv = priv; |
607 | 610 | ||
611 | host->irq_flags = IRQF_SHARED; | ||
612 | |||
608 | pci_set_drvdata(pdev[0], host); | 613 | pci_set_drvdata(pdev[0], host); |
609 | pci_set_drvdata(pdev[1], host); | 614 | pci_set_drvdata(pdev[1], host); |
610 | 615 | ||
@@ -619,7 +624,11 @@ int ide_pci_init_two(struct pci_dev *dev1, struct pci_dev *dev2, | |||
619 | goto out; | 624 | goto out; |
620 | 625 | ||
621 | /* fixup IRQ */ | 626 | /* fixup IRQ */ |
622 | hw[i*2 + 1].irq = hw[i*2].irq = ret; | 627 | if (ide_pci_is_in_compatibility_mode(pdev[i])) { |
628 | hw[i*2].irq = pci_get_legacy_ide_irq(pdev[i], 0); | ||
629 | hw[i*2 + 1].irq = pci_get_legacy_ide_irq(pdev[i], 1); | ||
630 | } else | ||
631 | hw[i*2 + 1].irq = hw[i*2].irq = ret; | ||
623 | } | 632 | } |
624 | 633 | ||
625 | ret = ide_host_register(host, d, hws); | 634 | ret = ide_host_register(host, d, hws); |