aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/ide-lib.c')
-rw-r--r--drivers/ide/ide-lib.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/ide/ide-lib.c b/drivers/ide/ide-lib.c
index fa4c194b5ede..c859de77aa8f 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)
290 ide_hwif_t *hwif = drive->hwif; 290 ide_hwif_t *hwif = drive->hwif;
291 u8 host_pio, pio; 291 u8 host_pio, pio;
292 292
293 if (hwif->set_pio_mode == NULL) 293 if (hwif->set_pio_mode == NULL ||
294 (hwif->host_flags & IDE_HFLAG_NO_SET_MODE))
294 return; 295 return;
295 296
296 BUG_ON(hwif->pio_mask == 0x00); 297 BUG_ON(hwif->pio_mask == 0x00);
@@ -343,6 +344,9 @@ int ide_set_pio_mode(ide_drive_t *drive, const u8 mode)
343{ 344{
344 ide_hwif_t *hwif = drive->hwif; 345 ide_hwif_t *hwif = drive->hwif;
345 346
347 if (hwif->host_flags & IDE_HFLAG_NO_SET_MODE)
348 return 0;
349
346 if (hwif->set_pio_mode == NULL) 350 if (hwif->set_pio_mode == NULL)
347 return -1; 351 return -1;
348 352
@@ -370,6 +374,9 @@ int ide_set_dma_mode(ide_drive_t *drive, const u8 mode)
370{ 374{
371 ide_hwif_t *hwif = drive->hwif; 375 ide_hwif_t *hwif = drive->hwif;
372 376
377 if (hwif->host_flags & IDE_HFLAG_NO_SET_MODE)
378 return 0;
379
373 if (hwif->set_dma_mode == NULL) 380 if (hwif->set_dma_mode == NULL)
374 return -1; 381 return -1;
375 382
@@ -400,7 +407,8 @@ int ide_set_xfer_rate(ide_drive_t *drive, u8 rate)
400{ 407{
401 ide_hwif_t *hwif = drive->hwif; 408 ide_hwif_t *hwif = drive->hwif;
402 409
403 if (hwif->set_dma_mode == NULL) 410 if (hwif->set_dma_mode == NULL ||
411 (hwif->host_flags & IDE_HFLAG_NO_SET_MODE))
404 return -1; 412 return -1;
405 413
406 rate = ide_rate_filter(drive, rate); 414 rate = ide_rate_filter(drive, rate);