X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fide%2Fide-probe.c;h=d27061b393243a8038e39e6fdb5fe92bef250bbb;hb=fbe0825752dc34b505777fd59cde4a6ce832eb16;hp=099a0fe1745b3c209cfc9f065b60308f643f3196;hpb=96916090f488986a4ebb8e9ffa6a3b50881d5ccd;p=linux-2.6 diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c index 099a0fe174..d27061b393 100644 --- a/drivers/ide/ide-probe.c +++ b/drivers/ide/ide-probe.c @@ -646,15 +646,12 @@ static int ide_register_port(ide_hwif_t *hwif) goto out; } - get_device(&hwif->gendev); - - hwif->portdev = device_create(ide_port_class, &hwif->gendev, - MKDEV(0, 0), hwif->name); + hwif->portdev = device_create_drvdata(ide_port_class, &hwif->gendev, + MKDEV(0, 0), hwif, hwif->name); if (IS_ERR(hwif->portdev)) { ret = PTR_ERR(hwif->portdev); device_unregister(&hwif->gendev); } - dev_set_drvdata(hwif->portdev, hwif); out: return ret; } @@ -1334,8 +1331,7 @@ static void ide_port_init_devices(ide_hwif_t *hwif) static void ide_init_port(ide_hwif_t *hwif, unsigned int port, const struct ide_port_info *d) { - if (d->chipset != ide_etrax100) - hwif->channel = port; + hwif->channel = port; if (d->chipset) hwif->chipset = d->chipset; @@ -1347,19 +1343,14 @@ static void ide_init_port(ide_hwif_t *hwif, unsigned int port, (d->host_flags & IDE_HFLAG_FORCE_LEGACY_IRQS)) hwif->irq = port ? 15 : 14; - hwif->host_flags = d->host_flags; + /* ->host_flags may be set by ->init_iops (or even earlier...) */ + hwif->host_flags |= d->host_flags; hwif->pio_mask = d->pio_mask; /* ->set_pio_mode for DTC2278 is currently limited to port 0 */ if (hwif->chipset != ide_dtc2278 || hwif->channel == 0) hwif->port_ops = d->port_ops; - if ((d->host_flags & IDE_HFLAG_SERIALIZE) || - ((d->host_flags & IDE_HFLAG_SERIALIZE_DMA) && hwif->dma_base)) { - if (hwif->mate) - hwif->mate->serialized = hwif->serialized = 1; - } - hwif->swdma_mask = d->swdma_mask; hwif->mwdma_mask = d->mwdma_mask; hwif->ultra_mask = d->udma_mask; @@ -1381,6 +1372,12 @@ static void ide_init_port(ide_hwif_t *hwif, unsigned int port, hwif->dma_ops = d->dma_ops; } + if ((d->host_flags & IDE_HFLAG_SERIALIZE) || + ((d->host_flags & IDE_HFLAG_SERIALIZE_DMA) && hwif->dma_base)) { + if (hwif->mate) + hwif->mate->serialized = hwif->serialized = 1; + } + if (d->host_flags & IDE_HFLAG_RQSIZE_256) hwif->rqsize = 256; @@ -1519,7 +1516,7 @@ int ide_device_add_all(u8 *idx, const struct ide_port_info *d) continue; } - if (d->chipset != ide_etrax100 && (i & 1) && mate) { + if ((i & 1) && mate) { hwif->mate = mate; mate->mate = hwif; } @@ -1665,6 +1662,7 @@ static void ide_legacy_init_one(u8 *idx, hw_regs_t *hw, u8 port_no, ide_std_init_ports(hw, base, ctl); hw->irq = irq; + hw->chipset = d->chipset; hwif = ide_find_port_slot(d); if (hwif) {