aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/ide/ide-dma.c3
-rw-r--r--drivers/ide/ide-io.c4
-rw-r--r--drivers/ide/ide-lib.c12
-rw-r--r--drivers/ide/ide.c4
4 files changed, 13 insertions, 10 deletions
diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c
index aaece2c06c9..8757e5ef6c9 100644
--- a/drivers/ide/ide-dma.c
+++ b/drivers/ide/ide-dma.c
@@ -706,9 +706,6 @@ static int ide_tune_dma(ide_drive_t *drive)
if (!speed)
return 0;
- if (hwif->host_flags & IDE_HFLAG_NO_SET_MODE)
- return 1;
-
if (ide_set_dma_mode(drive, speed))
return 0;
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c
index 31e5afadb7e..51d181ee9cf 100644
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -726,10 +726,6 @@ static ide_startstop_t do_special (ide_drive_t *drive)
s->b.set_tune = 0;
if (set_pio_mode_abuse(drive->hwif, req_pio)) {
-
- if (hwif->set_pio_mode == NULL)
- return ide_stopped;
-
/*
* take ide_lock for drive->[no_]unmask/[no_]io_32bit
*/
diff --git a/drivers/ide/ide-lib.c b/drivers/ide/ide-lib.c
index fa4c194b5ed..c859de77aa8 100644
--- a/drivers/ide/ide-lib.c
+++ b/drivers/ide/ide-lib.c
@@ -290,7 +290,8 @@ void ide_set_pio(ide_drive_t *drive, u8 req_pio)
ide_hwif_t *hwif = drive->hwif;
u8 host_pio, pio;
- if (hwif->set_pio_mode == NULL)
+ if (hwif->set_pio_mode == NULL ||
+ (hwif->host_flags & IDE_HFLAG_NO_SET_MODE))
return;
BUG_ON(hwif->pio_mask == 0x00);
@@ -343,6 +344,9 @@ int ide_set_pio_mode(ide_drive_t *drive, const u8 mode)
{
ide_hwif_t *hwif = drive->hwif;
+ if (hwif->host_flags & IDE_HFLAG_NO_SET_MODE)
+ return 0;
+
if (hwif->set_pio_mode == NULL)
return -1;
@@ -370,6 +374,9 @@ int ide_set_dma_mode(ide_drive_t *drive, const u8 mode)
{
ide_hwif_t *hwif = drive->hwif;
+ if (hwif->host_flags & IDE_HFLAG_NO_SET_MODE)
+ return 0;
+
if (hwif->set_dma_mode == NULL)
return -1;
@@ -400,7 +407,8 @@ int ide_set_xfer_rate(ide_drive_t *drive, u8 rate)
{
ide_hwif_t *hwif = drive->hwif;
- if (hwif->set_dma_mode == NULL)
+ if (hwif->set_dma_mode == NULL ||
+ (hwif->host_flags & IDE_HFLAG_NO_SET_MODE))
return -1;
rate = ide_rate_filter(drive, rate);
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c
index f04b53cb023..d868ca44d03 100644
--- a/drivers/ide/ide.c
+++ b/drivers/ide/ide.c
@@ -584,11 +584,13 @@ out:
int set_pio_mode(ide_drive_t *drive, int arg)
{
struct request rq;
+ ide_hwif_t *hwif = drive->hwif;
if (arg < 0 || arg > 255)
return -EINVAL;
- if (drive->hwif->set_pio_mode == NULL)
+ if (hwif->set_pio_mode == NULL ||
+ (hwif->host_flags & IDE_HFLAG_NO_SET_MODE))
return -ENOSYS;
if (drive->special.b.set_tune)