aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-devsets.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/ide-devsets.c')
-rw-r--r--drivers/ide/ide-devsets.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/ide/ide-devsets.c b/drivers/ide/ide-devsets.c
index 1099bf7cf968..9e98122f646e 100644
--- a/drivers/ide/ide-devsets.c
+++ b/drivers/ide/ide-devsets.c
@@ -1,5 +1,6 @@
1 1
2#include <linux/kernel.h> 2#include <linux/kernel.h>
3#include <linux/gfp.h>
3#include <linux/ide.h> 4#include <linux/ide.h>
4 5
5DEFINE_MUTEX(ide_setting_mtx); 6DEFINE_MUTEX(ide_setting_mtx);
@@ -105,15 +106,17 @@ static int set_pio_mode(ide_drive_t *drive, int arg)
105 return -ENOSYS; 106 return -ENOSYS;
106 107
107 if (set_pio_mode_abuse(drive->hwif, arg)) { 108 if (set_pio_mode_abuse(drive->hwif, arg)) {
109 drive->pio_mode = arg + XFER_PIO_0;
110
108 if (arg == 8 || arg == 9) { 111 if (arg == 8 || arg == 9) {
109 unsigned long flags; 112 unsigned long flags;
110 113
111 /* take lock for IDE_DFLAG_[NO_]UNMASK/[NO_]IO_32BIT */ 114 /* take lock for IDE_DFLAG_[NO_]UNMASK/[NO_]IO_32BIT */
112 spin_lock_irqsave(&hwif->lock, flags); 115 spin_lock_irqsave(&hwif->lock, flags);
113 port_ops->set_pio_mode(drive, arg); 116 port_ops->set_pio_mode(hwif, drive);
114 spin_unlock_irqrestore(&hwif->lock, flags); 117 spin_unlock_irqrestore(&hwif->lock, flags);
115 } else 118 } else
116 port_ops->set_pio_mode(drive, arg); 119 port_ops->set_pio_mode(hwif, drive);
117 } else { 120 } else {
118 int keep_dma = !!(drive->dev_flags & IDE_DFLAG_USING_DMA); 121 int keep_dma = !!(drive->dev_flags & IDE_DFLAG_USING_DMA);
119 122