Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
[pandora-kernel.git] / drivers / ide / ide.c
index 166acd5..ac61360 100644 (file)
@@ -683,6 +683,31 @@ void ide_init_port_hw(ide_hwif_t *hwif, hw_regs_t *hw)
 }
 EXPORT_SYMBOL_GPL(ide_init_port_hw);
 
+ide_hwif_t *ide_deprecated_find_port(unsigned long base)
+{
+       ide_hwif_t *hwif;
+       int i;
+
+       for (i = 0; i < MAX_HWIFS; i++) {
+               hwif = &ide_hwifs[i];
+               if (hwif->io_ports[IDE_DATA_OFFSET] == base)
+                       goto found;
+       }
+
+       for (i = 0; i < MAX_HWIFS; i++) {
+               hwif = &ide_hwifs[i];
+               if (hwif->hold)
+                       continue;
+               if (!hwif->present && hwif->mate == NULL)
+                       goto found;
+       }
+
+       hwif = NULL;
+found:
+       return hwif;
+}
+EXPORT_SYMBOL_GPL(ide_deprecated_find_port);
+
 /**
  *     ide_register_hw         -       register IDE interface
  *     @hw: hardware registers
@@ -702,18 +727,10 @@ int ide_register_hw(hw_regs_t *hw, void (*quirkproc)(ide_drive_t *),
        u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
 
        do {
-               for (index = 0; index < MAX_HWIFS; ++index) {
-                       hwif = &ide_hwifs[index];
-                       if (hwif->io_ports[IDE_DATA_OFFSET] == hw->io_ports[IDE_DATA_OFFSET])
-                               goto found;
-               }
-               for (index = 0; index < MAX_HWIFS; ++index) {
-                       hwif = &ide_hwifs[index];
-                       if (hwif->hold)
-                               continue;
-                       if (!hwif->present && hwif->mate == NULL)
-                               goto found;
-               }
+               hwif = ide_deprecated_find_port(hw->io_ports[IDE_DATA_OFFSET]);
+               index = hwif->index;
+               if (hwif)
+                       goto found;
                for (index = 0; index < MAX_HWIFS; index++)
                        ide_unregister(index, 1, 1);
        } while (retry--);
@@ -1018,11 +1035,8 @@ int generic_ide_ioctl(ide_drive_t *drive, struct file *file, struct block_device
                case HDIO_GET_NICE:
                        return put_user(drive->dsc_overlap      <<      IDE_NICE_DSC_OVERLAP    |
                                        drive->atapi_overlap    <<      IDE_NICE_ATAPI_OVERLAP  |
-                                       drive->nice0            <<      IDE_NICE_0              |
-                                       drive->nice1            <<      IDE_NICE_1              |
-                                       drive->nice2            <<      IDE_NICE_2,
+                                       drive->nice1 << IDE_NICE_1,
                                        (long __user *) arg);
-
 #ifdef CONFIG_IDE_TASK_IOCTL
                case HDIO_DRIVE_TASKFILE:
                        if (!capable(CAP_SYS_ADMIN) || !capable(CAP_SYS_RAWIO))