diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-04-26 11:36:43 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-04-26 11:36:43 -0400 |
commit | 784506cbddd17bcd5929f827df39b0c7014e3f1e (patch) | |
tree | 1daf7f9d1f8dafe309742c6d136c90923fa2f720 /drivers/ide/ide.c | |
parent | 4764b68405ac918e9ac9939b1a2d1469102e5af7 (diff) |
ide: sanitize handling of IDE_HFLAG_NO_SET_MODE host flag
* Check for IDE_HFLAG_NO_SET_MODE host flag in ide_set_pio(),
ide_set_[pio,dma]_mode(), ide_set_xfer_rate() and set_pio_mode().
* Remove no longer needed IDE_HFLAG_NO_SET_MODE host flag checking
from ide_tune_dma().
* Remove superfluous ->set_pio_mode checking from do_special().
This is a part of preparations for adding 'struct ide_port_ops'.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide.c')
-rw-r--r-- | drivers/ide/ide.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c index f04b53cb023f..d868ca44d033 100644 --- a/drivers/ide/ide.c +++ b/drivers/ide/ide.c | |||
@@ -584,11 +584,13 @@ out: | |||
584 | int set_pio_mode(ide_drive_t *drive, int arg) | 584 | int set_pio_mode(ide_drive_t *drive, int arg) |
585 | { | 585 | { |
586 | struct request rq; | 586 | struct request rq; |
587 | ide_hwif_t *hwif = drive->hwif; | ||
587 | 588 | ||
588 | if (arg < 0 || arg > 255) | 589 | if (arg < 0 || arg > 255) |
589 | return -EINVAL; | 590 | return -EINVAL; |
590 | 591 | ||
591 | if (drive->hwif->set_pio_mode == NULL) | 592 | if (hwif->set_pio_mode == NULL || |
593 | (hwif->host_flags & IDE_HFLAG_NO_SET_MODE)) | ||
592 | return -ENOSYS; | 594 | return -ENOSYS; |
593 | 595 | ||
594 | if (drive->special.b.set_tune) | 596 | if (drive->special.b.set_tune) |