Skip to content

Commit e085b3c

Browse files
bzolnierdavem330
authored andcommitted
ide: change ->set_pio_mode method parameters
Change ->set_pio_mode method parameters to match ->set_piomode method used in struct ata_port_operations. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 3fccaa1 commit e085b3c

44 files changed

Lines changed: 129 additions & 121 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎drivers/ide/aec62xx.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,10 @@ static void aec6260_set_mode(ide_drive_t *drive, const u8 speed)
134134
local_irq_restore(flags);
135135
}
136136

137-
static void aec_set_pio_mode(ide_drive_t *drive, const u8 pio)
137+
static void aec_set_pio_mode(ide_hwif_t *hwif, ide_drive_t *drive)
138138
{
139-
drive->dma_mode = pio + XFER_PIO_0;
140-
drive->hwif->port_ops->set_dma_mode(drive, pio + XFER_PIO_0);
139+
drive->dma_mode = drive->pio_mode;
140+
hwif->port_ops->set_dma_mode(drive, drive->dma_mode);
141141
}
142142

143143
static int init_chipset_aec62xx(struct pci_dev *dev)

‎drivers/ide/ali14xx.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,13 +109,14 @@ static DEFINE_SPINLOCK(ali14xx_lock);
109109
* This function computes timing parameters
110110
* and sets controller registers accordingly.
111111
*/
112-
static void ali14xx_set_pio_mode(ide_drive_t *drive, const u8 pio)
112+
static void ali14xx_set_pio_mode(ide_hwif_t *hwif, ide_drive_t *drive)
113113
{
114114
int driveNum;
115115
int time1, time2;
116116
u8 param1, param2, param3, param4;
117117
unsigned long flags;
118118
int bus_speed = ide_vlb_clk ? ide_vlb_clk : 50;
119+
const u8 pio = drive->pio_mode - XFER_PIO_0;
119120
struct ide_timing *t = ide_timing_find_mode(XFER_PIO_0 + pio);
120121

121122
/* calculate timing, according to PIO mode */

‎drivers/ide/alim15x3.c‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,23 +63,22 @@ static void ali_fifo_control(ide_hwif_t *hwif, ide_drive_t *drive, int on)
6363

6464
/**
6565
* ali_set_pio_mode - set host controller for PIO mode
66+
* @hwif: port
6667
* @drive: drive
67-
* @pio: PIO mode number
6868
*
6969
* Program the controller for the given PIO mode.
7070
*/
7171

72-
static void ali_set_pio_mode(ide_drive_t *drive, const u8 pio)
72+
static void ali_set_pio_mode(ide_hwif_t *hwif, ide_drive_t *drive)
7373
{
74-
ide_hwif_t *hwif = drive->hwif;
7574
struct pci_dev *dev = to_pci_dev(hwif->dev);
7675
int bus_speed = ide_pci_clk ? ide_pci_clk : 33;
7776
unsigned long T = 1000000 / bus_speed; /* PCI clock based */
7877
int port = hwif->channel ? 0x5c : 0x58;
7978
u8 unit = drive->dn & 1;
8079
struct ide_timing t;
8180

82-
ide_timing_compute(drive, XFER_PIO_0 + pio, &t, T, 1);
81+
ide_timing_compute(drive, drive->pio_mode, &t, T, 1);
8382

8483
t.setup = clamp_val(t.setup, 1, 8) & 7;
8584
t.active = clamp_val(t.active, 1, 8) & 7;

‎drivers/ide/amd74xx.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,9 @@ static void amd_set_drive(ide_drive_t *drive, const u8 speed)
108108
* amd_set_pio_mode() is a callback from upper layers for PIO-only tuning.
109109
*/
110110

111-
static void amd_set_pio_mode(ide_drive_t *drive, const u8 pio)
111+
static void amd_set_pio_mode(ide_hwif_t *hwif, ide_drive_t *drive)
112112
{
113-
amd_set_drive(drive, XFER_PIO_0 + pio);
113+
amd_set_drive(drive, drive->pio_mode);
114114
}
115115

116116
static void amd7409_cable_detect(struct pci_dev *dev)

‎drivers/ide/at91_ide.c‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,11 +172,12 @@ static void at91_ide_output_data(ide_drive_t *drive, struct ide_cmd *cmd,
172172
leave_16bit(chipselect, mode);
173173
}
174174

175-
static void at91_ide_set_pio_mode(ide_drive_t *drive, const u8 pio)
175+
static void at91_ide_set_pio_mode(ide_hwif_t *hwif, ide_drive_t *drive)
176176
{
177177
struct ide_timing *timing;
178-
u8 chipselect = drive->hwif->select_data;
178+
u8 chipselect = hwif->select_data;
179179
int use_iordy = 0;
180+
const u8 pio = drive->pio_mode - XFER_PIO_0;
180181

181182
pdbg("chipselect %u pio %u\n", chipselect, pio);
182183

‎drivers/ide/atiixp.c‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,19 +42,20 @@ static DEFINE_SPINLOCK(atiixp_lock);
4242

4343
/**
4444
* atiixp_set_pio_mode - set host controller for PIO mode
45+
* @hwif: port
4546
* @drive: drive
46-
* @pio: PIO mode number
4747
*
4848
* Set the interface PIO mode.
4949
*/
5050

51-
static void atiixp_set_pio_mode(ide_drive_t *drive, const u8 pio)
51+
static void atiixp_set_pio_mode(ide_hwif_t *hwif, ide_drive_t *drive)
5252
{
53-
struct pci_dev *dev = to_pci_dev(drive->hwif->dev);
53+
struct pci_dev *dev = to_pci_dev(hwif->dev);
5454
unsigned long flags;
5555
int timing_shift = (drive->dn ^ 1) * 8;
5656
u32 pio_timing_data;
5757
u16 pio_mode_data;
58+
const u8 pio = drive->pio_mode - XFER_PIO_0;
5859

5960
spin_lock_irqsave(&atiixp_lock, flags);
6061

‎drivers/ide/au1xxx-ide.c‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,11 @@ static void au1xxx_output_data(ide_drive_t *drive, struct ide_cmd *cmd,
9999
}
100100
#endif
101101

102-
static void au1xxx_set_pio_mode(ide_drive_t *drive, const u8 pio)
102+
static void au1xxx_set_pio_mode(ide_hwif_t *hwif, ide_drive_t *drive)
103103
{
104104
int mem_sttime = 0, mem_stcfg = au_readl(MEM_STCFG2);
105105

106-
/* set pio mode! */
107-
switch(pio) {
106+
switch (drive->pio_mode - XFER_PIO_0) {
108107
case 0:
109108
mem_sttime = SBC_IDE_TIMING(PIO0);
110109

‎drivers/ide/cmd640.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -572,9 +572,10 @@ static void cmd640_set_mode(ide_drive_t *drive, unsigned int index,
572572
program_drive_counts(drive, index);
573573
}
574574

575-
static void cmd640_set_pio_mode(ide_drive_t *drive, const u8 pio)
575+
static void cmd640_set_pio_mode(ide_hwif_t *hwif, ide_drive_t *drive)
576576
{
577577
unsigned int index = 0, cycle_time;
578+
const u8 pio = drive->pio_mode - XFER_PIO_0;
578579
u8 b;
579580

580581
switch (pio) {

‎drivers/ide/cmd64x.c‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,10 @@ static void cmd64x_program_timings(ide_drive_t *drive, u8 mode)
127127
* Special cases are 8: prefetch off, 9: prefetch on (both never worked)
128128
*/
129129

130-
static void cmd64x_set_pio_mode(ide_drive_t *drive, const u8 pio)
130+
static void cmd64x_set_pio_mode(ide_hwif_t *hwif, ide_drive_t *drive)
131131
{
132+
const u8 pio = drive->pio_mode - XFER_PIO_0;
133+
132134
/*
133135
* Filter out the prefetch control values
134136
* to prevent PIO5 from being programmed

‎drivers/ide/cs5520.c‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,11 @@ static struct pio_clocks cs5520_pio_clocks[]={
5757
{1, 2, 1}
5858
};
5959

60-
static void cs5520_set_pio_mode(ide_drive_t *drive, const u8 pio)
60+
static void cs5520_set_pio_mode(ide_hwif_t *hwif, ide_drive_t *drive)
6161
{
62-
ide_hwif_t *hwif = drive->hwif;
6362
struct pci_dev *pdev = to_pci_dev(hwif->dev);
6463
int controller = drive->dn > 1 ? 1 : 0;
64+
const u8 pio = drive->pio_mode - XFER_PIO_0;
6565

6666
/* 8bit CAT/CRT - 8bit command timing for channel */
6767
pci_write_config_byte(pdev, 0x62 + controller,
@@ -85,7 +85,8 @@ static void cs5520_set_dma_mode(ide_drive_t *drive, const u8 speed)
8585
{
8686
printk(KERN_ERR "cs55x0: bad ide timing.\n");
8787

88-
cs5520_set_pio_mode(drive, 0);
88+
drive->pio_mode = XFER_PIO_0 + 0;
89+
cs5520_set_pio_mode(drive->hwif, drive);
8990
}
9091

9192
static const struct ide_port_ops cs5520_port_ops = {

0 commit comments

Comments
 (0)