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.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c
index d868ca44d03..91a3c8aff1e 100644
--- a/drivers/ide/ide.c
+++ b/drivers/ide/ide.c
@@ -585,11 +585,12 @@ 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 ide_hwif_t *hwif = drive->hwif;
588 const struct ide_port_ops *port_ops = hwif->port_ops;
588 589
589 if (arg < 0 || arg > 255) 590 if (arg < 0 || arg > 255)
590 return -EINVAL; 591 return -EINVAL;
591 592
592 if (hwif->set_pio_mode == NULL || 593 if (port_ops == NULL || port_ops->set_pio_mode == NULL ||
593 (hwif->host_flags & IDE_HFLAG_NO_SET_MODE)) 594 (hwif->host_flags & IDE_HFLAG_NO_SET_MODE))
594 return -ENOSYS; 595 return -ENOSYS;
595 596