From 4dc3d3aa8b4bef0fcad007eb0e373ee5445fc4a7 Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Sat, 26 Jan 2008 20:13:08 +0100 Subject: [PATCH] --- yaml --- r: 77263 b: refs/heads/master c: 79127c37aa5d959c9ace40a869386f712b55ac6d h: refs/heads/master i: 77261: c2808481e12fc673ec733b6ef4473e2721533744 77259: 16dbf39e3b2f0f697462741efc2d5b311e7061b5 77255: 7050d44ffd95ef19c7d9370c6ae27749bd081f98 77247: 1908121bc16a08328489e76313c738867d1f2623 v: v3 --- [refs] | 2 +- trunk/drivers/ide/setup-pci.c | 33 +++++++++++++++++---------------- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/[refs] b/[refs] index 9ea68d16871b..b33c707131f7 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 6828fc9a919b06723599192300053ddf6f638c95 +refs/heads/master: 79127c37aa5d959c9ace40a869386f712b55ac6d diff --git a/trunk/drivers/ide/setup-pci.c b/trunk/drivers/ide/setup-pci.c index caa4a6a32711..be9ae5a38cc7 100644 --- a/trunk/drivers/ide/setup-pci.c +++ b/trunk/drivers/ide/setup-pci.c @@ -363,6 +363,8 @@ static ide_hwif_t *ide_hwif_configure(struct pci_dev *dev, const struct ide_port unsigned long ctl = 0, base = 0; ide_hwif_t *hwif; u8 bootable = (d->host_flags & IDE_HFLAG_BOOTABLE) ? 1 : 0; + u8 oldnoprobe = 0; + struct hw_regs_s hw; if ((d->host_flags & IDE_HFLAG_ISA_PORTS) == 0) { /* Possibly we should fail if these checks report true */ @@ -385,22 +387,25 @@ static ide_hwif_t *ide_hwif_configure(struct pci_dev *dev, const struct ide_port } if ((hwif = ide_match_hwif(base, bootable, d->name)) == NULL) return NULL; /* no room in ide_hwifs[] */ - if (hwif->io_ports[IDE_DATA_OFFSET] != base || - hwif->io_ports[IDE_CONTROL_OFFSET] != (ctl | 2)) { - hw_regs_t hw; - - memset(&hw, 0, sizeof(hw)); - ide_std_init_ports(&hw, base, ctl | 2); - memcpy(hwif->io_ports, hw.io_ports, sizeof(hwif->io_ports)); - hwif->noprobe = 0; - } - hwif->chipset = d->chipset ? d->chipset : ide_pci; + + memset(&hw, 0, sizeof(hw)); + hw.irq = hwif->irq ? hwif->irq : irq; + hw.dev = &dev->dev; + hw.chipset = d->chipset ? d->chipset : ide_pci; + ide_std_init_ports(&hw, base, ctl | 2); + + if (hwif->io_ports[IDE_DATA_OFFSET] == base && + hwif->io_ports[IDE_CONTROL_OFFSET] == (ctl | 2)) + oldnoprobe = hwif->noprobe; + + ide_init_port_hw(hwif, &hw); + + hwif->noprobe = oldnoprobe; + hwif->pci_dev = dev; hwif->cds = d; hwif->channel = port; - if (!hwif->irq) - hwif->irq = irq; if (mate) { hwif->mate = mate; mate->mate = hwif; @@ -535,12 +540,8 @@ void ide_pci_setup_ports(struct pci_dev *dev, const struct ide_port_info *d, int if ((hwif = ide_hwif_configure(dev, d, mate, port, pciirq)) == NULL) continue; - /* setup proper ancestral information */ - hwif->gendev.parent = &dev->dev; - *(idx + port) = hwif->index; - if (d->init_iops) d->init_iops(hwif);