]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/ide/ide.c
misc: fix platform driver hotplug/coldplug
[linux-2.6-omap-h63xx.git] / drivers / ide / ide.c
index ad0e9955f73c9ce38de7485b487bb778b9542e87..fc69fe2e3ec0ede1c5beb62e4ed05adfb85d94a7 100644 (file)
@@ -44,8 +44,6 @@
  *  inspiration from lots of linux users, esp.  hamish@zot.apana.org.au
  */
 
-#define        REVISION        "Revision: 7.00alpha2"
-
 #define _IDE_C                 /* Tell ide.h it's really us */
 
 #include <linux/module.h>
@@ -592,11 +590,6 @@ void ide_unregister(unsigned int index, int init_default, int restore)
                hwif->extra_ports = 0;
        }
 
-       /*
-        * Note that we only release the standard ports,
-        * and do not even try to handle any extra ports
-        * allocated for weird IDE interface chipsets.
-        */
        ide_hwif_release_regions(hwif);
 
        /* copy original settings */
@@ -674,7 +667,6 @@ int ide_register_hw(hw_regs_t *hw, void (*quirkproc)(ide_drive_t *),
 
        do {
                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++)
@@ -682,6 +674,7 @@ int ide_register_hw(hw_regs_t *hw, void (*quirkproc)(ide_drive_t *),
        } while (retry--);
        return -1;
 found:
+       index = hwif->index;
        if (hwif->present)
                ide_unregister(index, 0, 1);
        else if (!hwif->hold)
@@ -1038,10 +1031,9 @@ int generic_ide_ioctl(ide_drive_t *drive, struct file *file, struct block_device
                        drive->nice1 = (arg >> IDE_NICE_1) & 1;
                        return 0;
                case HDIO_DRIVE_RESET:
-               {
-                       unsigned long flags;
-                       if (!capable(CAP_SYS_ADMIN)) return -EACCES;
-                       
+                       if (!capable(CAP_SYS_ADMIN))
+                               return -EACCES;
+
                        /*
                         *      Abort the current command on the
                         *      group if there is one, taking
@@ -1060,17 +1052,15 @@ int generic_ide_ioctl(ide_drive_t *drive, struct file *file, struct block_device
                        ide_abort(drive, "drive reset");
 
                        BUG_ON(HWGROUP(drive)->handler);
-                               
+
                        /* Ensure nothing gets queued after we
                           drop the lock. Reset will clear the busy */
-                  
+
                        HWGROUP(drive)->busy = 1;
                        spin_unlock_irqrestore(&ide_lock, flags);
                        (void) ide_do_reset(drive);
 
                        return 0;
-               }
-
                case HDIO_GET_BUSSTATE:
                        if (!capable(CAP_SYS_ADMIN))
                                return -EACCES;
@@ -1190,7 +1180,7 @@ static int __initdata is_chipset_set[MAX_HWIFS];
  * ide_setup() gets called VERY EARLY during initialization,
  * to handle kernel "command line" strings beginning with "hdx=" or "ide".
  *
- * Remember to update Documentation/ide.txt if you change something here.
+ * Remember to update Documentation/ide/ide.txt if you change something here.
  */
 static int __init ide_setup(char *s)
 {
@@ -1231,7 +1221,7 @@ static int __init ide_setup(char *s)
        if (!strcmp(s, "ide=reverse")) {
                ide_scan_direction = 1;
                printk(" : Enabled support for IDE inverse scan order.\n");
-               return 1;
+               goto obsolete_option;
        }
 #endif
 
@@ -1268,7 +1258,7 @@ static int __init ide_setup(char *s)
                drive = &hwif->drives[unit];
                if (strncmp(s + 4, "ide-", 4) == 0) {
                        strlcpy(drive->driver_req, s + 4, sizeof(drive->driver_req));
-                       goto done;
+                       goto obsolete_option;
                }
                switch (match_parm(&s[3], hd_words, vals, 3)) {
                        case -1: /* "none" */
@@ -1300,13 +1290,13 @@ static int __init ide_setup(char *s)
                                goto done;
                        case -12: /* "remap" */
                                drive->remap_0_to_1 = 1;
-                               goto done;
+                               goto obsolete_option;
                        case -13: /* "remap63" */
                                drive->sect0 = 63;
-                               goto done;
+                               goto obsolete_option;
                        case -14: /* "scsi" */
                                drive->scsi = 1;
-                               goto done;
+                               goto obsolete_option;
                        case 3: /* cyl,head,sect */
                                drive->media    = ide_disk;
                                drive->ready_stat = READY_STAT;
@@ -1380,32 +1370,32 @@ static int __init ide_setup(char *s)
 #ifdef CONFIG_BLK_DEV_ALI14XX
                        case -17: /* "ali14xx" */
                                probe_ali14xx = 1;
-                               goto done;
+                               goto obsolete_option;
 #endif
 #ifdef CONFIG_BLK_DEV_UMC8672
                        case -16: /* "umc8672" */
                                probe_umc8672 = 1;
-                               goto done;
+                               goto obsolete_option;
 #endif
 #ifdef CONFIG_BLK_DEV_DTC2278
                        case -15: /* "dtc2278" */
                                probe_dtc2278 = 1;
-                               goto done;
+                               goto obsolete_option;
 #endif
 #ifdef CONFIG_BLK_DEV_CMD640
                        case -14: /* "cmd640_vlb" */
                                cmd640_vlb = 1;
-                               goto done;
+                               goto obsolete_option;
 #endif
 #ifdef CONFIG_BLK_DEV_HT6560B
                        case -13: /* "ht6560b" */
                                probe_ht6560b = 1;
-                               goto done;
+                               goto obsolete_option;
 #endif
 #ifdef CONFIG_BLK_DEV_QD65XX
                        case -12: /* "qd65xx" */
                                probe_qd65xx = 1;
-                               goto done;
+                               goto obsolete_option;
 #endif
 #ifdef CONFIG_BLK_DEV_4DRIVES
                        case -11: /* "four" drives on one set of ports */
@@ -1451,7 +1441,7 @@ static int __init ide_setup(char *s)
 
                        case -1: /* "noprobe" */
                                hwif->noprobe = 1;
-                               goto done;
+                               goto obsolete_option;
 
                        case 1: /* base */
                                vals[1] = vals[0] + 0x206; /* default ctl */
@@ -1618,7 +1608,7 @@ static int __init ide_init(void)
 {
        int ret;
 
-       printk(KERN_INFO "Uniform Multi-Platform E-IDE driver " REVISION "\n");
+       printk(KERN_INFO "Uniform Multi-Platform E-IDE driver\n");
        system_bus_speed = ide_system_bus_speed();
 
        printk(KERN_INFO "ide: Assuming %dMHz system bus speed "