aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/ide.c')
-rw-r--r--drivers/ide/ide.c24
1 files changed, 8 insertions, 16 deletions
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c
index 477833f0daf5..9976f9d627d4 100644
--- a/drivers/ide/ide.c
+++ b/drivers/ide/ide.c
@@ -590,11 +590,6 @@ void ide_unregister(unsigned int index, int init_default, int restore)
590 hwif->extra_ports = 0; 590 hwif->extra_ports = 0;
591 } 591 }
592 592
593 /*
594 * Note that we only release the standard ports,
595 * and do not even try to handle any extra ports
596 * allocated for weird IDE interface chipsets.
597 */
598 ide_hwif_release_regions(hwif); 593 ide_hwif_release_regions(hwif);
599 594
600 /* copy original settings */ 595 /* copy original settings */
@@ -672,7 +667,6 @@ int ide_register_hw(hw_regs_t *hw, void (*quirkproc)(ide_drive_t *),
672 667
673 do { 668 do {
674 hwif = ide_deprecated_find_port(hw->io_ports[IDE_DATA_OFFSET]); 669 hwif = ide_deprecated_find_port(hw->io_ports[IDE_DATA_OFFSET]);
675 index = hwif->index;
676 if (hwif) 670 if (hwif)
677 goto found; 671 goto found;
678 for (index = 0; index < MAX_HWIFS; index++) 672 for (index = 0; index < MAX_HWIFS; index++)
@@ -680,6 +674,7 @@ int ide_register_hw(hw_regs_t *hw, void (*quirkproc)(ide_drive_t *),
680 } while (retry--); 674 } while (retry--);
681 return -1; 675 return -1;
682found: 676found:
677 index = hwif->index;
683 if (hwif->present) 678 if (hwif->present)
684 ide_unregister(index, 0, 1); 679 ide_unregister(index, 0, 1);
685 else if (!hwif->hold) 680 else if (!hwif->hold)
@@ -1036,10 +1031,9 @@ int generic_ide_ioctl(ide_drive_t *drive, struct file *file, struct block_device
1036 drive->nice1 = (arg >> IDE_NICE_1) & 1; 1031 drive->nice1 = (arg >> IDE_NICE_1) & 1;
1037 return 0; 1032 return 0;
1038 case HDIO_DRIVE_RESET: 1033 case HDIO_DRIVE_RESET:
1039 { 1034 if (!capable(CAP_SYS_ADMIN))
1040 unsigned long flags; 1035 return -EACCES;
1041 if (!capable(CAP_SYS_ADMIN)) return -EACCES; 1036
1042
1043 /* 1037 /*
1044 * Abort the current command on the 1038 * Abort the current command on the
1045 * group if there is one, taking 1039 * group if there is one, taking
@@ -1058,17 +1052,15 @@ int generic_ide_ioctl(ide_drive_t *drive, struct file *file, struct block_device
1058 ide_abort(drive, "drive reset"); 1052 ide_abort(drive, "drive reset");
1059 1053
1060 BUG_ON(HWGROUP(drive)->handler); 1054 BUG_ON(HWGROUP(drive)->handler);
1061 1055
1062 /* Ensure nothing gets queued after we 1056 /* Ensure nothing gets queued after we
1063 drop the lock. Reset will clear the busy */ 1057 drop the lock. Reset will clear the busy */
1064 1058
1065 HWGROUP(drive)->busy = 1; 1059 HWGROUP(drive)->busy = 1;
1066 spin_unlock_irqrestore(&ide_lock, flags); 1060 spin_unlock_irqrestore(&ide_lock, flags);
1067 (void) ide_do_reset(drive); 1061 (void) ide_do_reset(drive);
1068 1062
1069 return 0; 1063 return 0;
1070 }
1071
1072 case HDIO_GET_BUSSTATE: 1064 case HDIO_GET_BUSSTATE:
1073 if (!capable(CAP_SYS_ADMIN)) 1065 if (!capable(CAP_SYS_ADMIN))
1074 return -EACCES; 1066 return -EACCES;
@@ -1188,7 +1180,7 @@ static int __initdata is_chipset_set[MAX_HWIFS];
1188 * ide_setup() gets called VERY EARLY during initialization, 1180 * ide_setup() gets called VERY EARLY during initialization,
1189 * to handle kernel "command line" strings beginning with "hdx=" or "ide". 1181 * to handle kernel "command line" strings beginning with "hdx=" or "ide".
1190 * 1182 *
1191 * Remember to update Documentation/ide.txt if you change something here. 1183 * Remember to update Documentation/ide/ide.txt if you change something here.
1192 */ 1184 */
1193static int __init ide_setup(char *s) 1185static int __init ide_setup(char *s)
1194{ 1186{
@@ -1449,7 +1441,7 @@ static int __init ide_setup(char *s)
1449 1441
1450 case -1: /* "noprobe" */ 1442 case -1: /* "noprobe" */
1451 hwif->noprobe = 1; 1443 hwif->noprobe = 1;
1452 goto done; 1444 goto obsolete_option;
1453 1445
1454 case 1: /* base */ 1446 case 1: /* base */
1455 vals[1] = vals[0] + 0x206; /* default ctl */ 1447 vals[1] = vals[0] + 0x206; /* default ctl */