]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/ide/ide-probe.c
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux...
[linux-2.6-omap-h63xx.git] / drivers / ide / ide-probe.c
index c1cd1af2646b98c06cdfc3b1166007ecb14c2182..a64ec259f3d13a50c01468c98669a9712f33d9f1 100644 (file)
@@ -110,20 +110,22 @@ static void ide_disk_init_mult_count(ide_drive_t *drive)
  *     read and parse the results. This function is run with
  *     interrupts disabled. 
  */
-static inline void do_identify (ide_drive_t *drive, u8 cmd)
+
+static void do_identify(ide_drive_t *drive, u8 cmd)
 {
        ide_hwif_t *hwif = HWIF(drive);
        u16 *id = drive->id;
        char *m = (char *)&id[ATA_ID_PROD];
+       unsigned long flags;
        int bswap = 1, is_cfa;
 
+       /* local CPU only; some systems need this */
+       local_irq_save(flags);
        /* read 512 bytes of id info */
        hwif->tp_ops->input_data(drive, NULL, id, SECTOR_SIZE);
+       local_irq_restore(flags);
 
        drive->dev_flags |= IDE_DFLAG_ID_READ;
-
-       local_irq_enable();
 #ifdef DEBUG
        printk(KERN_INFO "%s: dumping identify data\n", drive->name);
        ide_dump_identify((u8 *)id);
@@ -306,17 +308,12 @@ static int actual_try_to_identify (ide_drive_t *drive, u8 cmd)
        s = tp_ops->read_status(hwif);
 
        if (OK_STAT(s, ATA_DRQ, BAD_R_STAT)) {
-               unsigned long flags;
-
-               /* local CPU only; some systems need this */
-               local_irq_save(flags);
                /* drive returned ID */
                do_identify(drive, cmd);
                /* drive responded with ID */
                rc = 0;
                /* clear drive IRQ */
                (void)tp_ops->read_status(hwif);
-               local_irq_restore(flags);
        } else {
                /* drive refused ID */
                rc = 2;
@@ -554,8 +551,8 @@ static void enable_nest (ide_drive_t *drive)
  *                     1  device was found
  *                        (note: IDE_DFLAG_PRESENT might still be not set)
  */
-static inline u8 probe_for_drive (ide_drive_t *drive)
+
+static u8 probe_for_drive(ide_drive_t *drive)
 {
        char *m;
 
@@ -642,7 +639,7 @@ static int ide_register_port(ide_hwif_t *hwif)
        int ret;
 
        /* register with global device tree */
-       strlcpy(hwif->gendev.bus_id,hwif->name,BUS_ID_SIZE);
+       dev_set_name(&hwif->gendev, hwif->name);
        hwif->gendev.driver_data = hwif;
        if (hwif->gendev.parent == NULL) {
                if (hwif->dev)
@@ -1315,7 +1312,7 @@ static void hwif_register_devices(ide_hwif_t *hwif)
                if ((drive->dev_flags & IDE_DFLAG_PRESENT) == 0)
                        continue;
 
-               snprintf(dev->bus_id, BUS_ID_SIZE, "%u.%u", hwif->index, i);
+               dev_set_name(dev, "%u.%u", hwif->index, i);
                dev->parent = &hwif->gendev;
                dev->bus = &ide_bus_type;
                dev->driver_data = drive;
@@ -1755,59 +1752,3 @@ void ide_port_scan(ide_hwif_t *hwif)
        ide_proc_port_register_devices(hwif);
 }
 EXPORT_SYMBOL_GPL(ide_port_scan);
-
-static void ide_legacy_init_one(hw_regs_t **hws, hw_regs_t *hw,
-                               u8 port_no, const struct ide_port_info *d,
-                               unsigned long config)
-{
-       unsigned long base, ctl;
-       int irq;
-
-       if (port_no == 0) {
-               base = 0x1f0;
-               ctl  = 0x3f6;
-               irq  = 14;
-       } else {
-               base = 0x170;
-               ctl  = 0x376;
-               irq  = 15;
-       }
-
-       if (!request_region(base, 8, d->name)) {
-               printk(KERN_ERR "%s: I/O resource 0x%lX-0x%lX not free.\n",
-                               d->name, base, base + 7);
-               return;
-       }
-
-       if (!request_region(ctl, 1, d->name)) {
-               printk(KERN_ERR "%s: I/O resource 0x%lX not free.\n",
-                               d->name, ctl);
-               release_region(base, 8);
-               return;
-       }
-
-       ide_std_init_ports(hw, base, ctl);
-       hw->irq = irq;
-       hw->chipset = d->chipset;
-       hw->config = config;
-
-       hws[port_no] = hw;
-}
-
-int ide_legacy_device_add(const struct ide_port_info *d, unsigned long config)
-{
-       hw_regs_t hw[2], *hws[] = { NULL, NULL, NULL, NULL };
-
-       memset(&hw, 0, sizeof(hw));
-
-       if ((d->host_flags & IDE_HFLAG_QD_2ND_PORT) == 0)
-               ide_legacy_init_one(hws, &hw[0], 0, d, config);
-       ide_legacy_init_one(hws, &hw[1], 1, d, config);
-
-       if (hws[0] == NULL && hws[1] == NULL &&
-           (d->host_flags & IDE_HFLAG_SINGLE))
-               return -ENOENT;
-
-       return ide_host_add(d, hws, NULL);
-}
-EXPORT_SYMBOL_GPL(ide_legacy_device_add);