]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/ide/ide-probe.c
hwmon: (lm85) Don't write back cached values
[linux-2.6-omap-h63xx.git] / drivers / ide / ide-probe.c
index 099a0fe1745b3c209cfc9f065b60308f643f3196..26e68b65b7cf554c09869f65eba2e8940489238e 100644 (file)
@@ -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;
 }
@@ -1221,16 +1218,12 @@ static void drive_release_dev (struct device *dev)
        complete(&drive->gendev_rel_comp);
 }
 
-#ifndef ide_default_irq
-#define ide_default_irq(irq) 0
-#endif
-
 static int hwif_init(ide_hwif_t *hwif)
 {
        int old_irq;
 
        if (!hwif->irq) {
-               hwif->irq = ide_default_irq(hwif->io_ports.data_addr);
+               hwif->irq = __ide_default_irq(hwif->io_ports.data_addr);
                if (!hwif->irq) {
                        printk("%s: DISABLED, NO IRQ\n", hwif->name);
                        return 0;
@@ -1260,7 +1253,7 @@ static int hwif_init(ide_hwif_t *hwif)
         *      It failed to initialise. Find the default IRQ for 
         *      this port and try that.
         */
-       hwif->irq = ide_default_irq(hwif->io_ports.data_addr);
+       hwif->irq = __ide_default_irq(hwif->io_ports.data_addr);
        if (!hwif->irq) {
                printk("%s: Disabled unable to get IRQ %d.\n",
                        hwif->name, old_irq);
@@ -1334,8 +1327,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 +1339,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 +1368,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 +1512,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 +1658,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) {