aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-lib.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-07-19 19:11:58 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-07-19 19:11:58 -0400
commit6a824c92db4d606c324272c4eed366fb71672440 (patch)
tree72b398062fd582b85507b665120f0a5315548eaf /drivers/ide/ide-lib.c
parent2134758d2a5429325cee4d4ce8959af5314eeba1 (diff)
ide: remove ide_find_best_pio_mode()
* Add ->host_flags to ide_hwif_t to store ide_pci_device_t.host_flags, assign it in setup-pci.c:ide_pci_setup_ports(). * Add IDE_HFLAG_PIO_NO_{BLACKLIST,DOWNGRADE} to ide_pci_device_t.host_flags and teach ide_get_best_pio_mode() about them. Also remove needless !drive->id check while at it (drive->id is always present). * Convert amd74xx, via82cxxx and ide-timing.h to use ide_get_best_pio_mode() and then remove no longer needed ide_find_best_pio_mode(). There should be no functionality changes caused by this patch. Acked-by: Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-lib.c')
-rw-r--r--drivers/ide/ide-lib.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/ide/ide-lib.c b/drivers/ide/ide-lib.c
index df29868209f3..92a6c7bcf527 100644
--- a/drivers/ide/ide-lib.c
+++ b/drivers/ide/ide-lib.c
@@ -291,11 +291,11 @@ u8 ide_get_best_pio_mode (ide_drive_t *drive, u8 mode_wanted, u8 max_mode)
291 struct hd_driveid* id = drive->id; 291 struct hd_driveid* id = drive->id;
292 int overridden = 0; 292 int overridden = 0;
293 293
294 if (mode_wanted != 255) { 294 if (mode_wanted != 255)
295 pio_mode = mode_wanted; 295 return min_t(u8, mode_wanted, max_mode);
296 } else if (!drive->id) { 296
297 pio_mode = 0; 297 if ((drive->hwif->host_flags & IDE_HFLAG_PIO_NO_BLACKLIST) == 0 &&
298 } else if ((pio_mode = ide_scan_pio_blacklist(id->model)) != -1) { 298 (pio_mode = ide_scan_pio_blacklist(id->model)) != -1) {
299 printk(KERN_INFO "%s: is on PIO blacklist\n", drive->name); 299 printk(KERN_INFO "%s: is on PIO blacklist\n", drive->name);
300 } else { 300 } else {
301 pio_mode = id->tPIO; 301 pio_mode = id->tPIO;
@@ -324,7 +324,8 @@ u8 ide_get_best_pio_mode (ide_drive_t *drive, u8 mode_wanted, u8 max_mode)
324 /* 324 /*
325 * Conservative "downgrade" for all pre-ATA2 drives 325 * Conservative "downgrade" for all pre-ATA2 drives
326 */ 326 */
327 if (pio_mode && pio_mode < 4) { 327 if ((drive->hwif->host_flags & IDE_HFLAG_PIO_NO_DOWNGRADE) == 0 &&
328 pio_mode && pio_mode < 4) {
328 pio_mode--; 329 pio_mode--;
329 printk(KERN_INFO "%s: applying conservative " 330 printk(KERN_INFO "%s: applying conservative "
330 "PIO \"downgrade\"\n", drive->name); 331 "PIO \"downgrade\"\n", drive->name);