aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/cmd64x.c
diff options
context:
space:
mode:
authorJoao Ramos <joao.ramos@inov.pt>2009-06-15 16:13:44 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-06-15 16:13:44 -0400
commit5bfb151f1f565e6082304a30e8c81dfb6ed0b0c8 (patch)
tree331727c29645788035c4f4b0e617f8f0c9c52e1d /drivers/ide/cmd64x.c
parent3779f818a42879038c4be8bc83123432b774279d (diff)
ide: do not access ide_drive_t 'drive_data' field directly
Change ide_drive_t 'drive_data' field from 'unsigned int' type to 'void *' type, allowing a wider range of values/types to be stored in this field. Added 'ide_get_drivedata' and 'ide_set_drivedata' helpers to get and set the 'drive_data' field. Fixed all host drivers to maintain coherency with the change in the 'drive_data' field type. Signed-off-by: Joao Ramos <joao.ramos@inov.pt> [bart: fix qd65xx build, cast to 'unsigned long', minor Coding Style fixups] Acked-by: Sergei Shtylyov <sshtylyov@ru.montavista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/cmd64x.c')
-rw-r--r--drivers/ide/cmd64x.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/ide/cmd64x.c b/drivers/ide/cmd64x.c
index fd904e923a9f..03c86209446f 100644
--- a/drivers/ide/cmd64x.c
+++ b/drivers/ide/cmd64x.c
@@ -118,8 +118,9 @@ static void cmd64x_tune_pio(ide_drive_t *drive, const u8 pio)
118 ide_hwif_t *hwif = drive->hwif; 118 ide_hwif_t *hwif = drive->hwif;
119 struct pci_dev *dev = to_pci_dev(hwif->dev); 119 struct pci_dev *dev = to_pci_dev(hwif->dev);
120 struct ide_timing *t = ide_timing_find_mode(XFER_PIO_0 + pio); 120 struct ide_timing *t = ide_timing_find_mode(XFER_PIO_0 + pio);
121 unsigned long setup_count;
121 unsigned int cycle_time; 122 unsigned int cycle_time;
122 u8 setup_count, arttim = 0; 123 u8 arttim = 0;
123 124
124 static const u8 setup_values[] = {0x40, 0x40, 0x40, 0x80, 0, 0xc0}; 125 static const u8 setup_values[] = {0x40, 0x40, 0x40, 0x80, 0, 0xc0};
125 static const u8 arttim_regs[4] = {ARTTIM0, ARTTIM1, ARTTIM23, ARTTIM23}; 126 static const u8 arttim_regs[4] = {ARTTIM0, ARTTIM1, ARTTIM23, ARTTIM23};
@@ -140,10 +141,11 @@ static void cmd64x_tune_pio(ide_drive_t *drive, const u8 pio)
140 if (hwif->channel) { 141 if (hwif->channel) {
141 ide_drive_t *pair = ide_get_pair_dev(drive); 142 ide_drive_t *pair = ide_get_pair_dev(drive);
142 143
143 drive->drive_data = setup_count; 144 ide_set_drivedata(drive, (void *)setup_count);
144 145
145 if (pair) 146 if (pair)
146 setup_count = max_t(u8, setup_count, pair->drive_data); 147 setup_count = max_t(u8, setup_count,
148 (unsigned long)ide_get_drivedata(pair));
147 } 149 }
148 150
149 if (setup_count > 5) /* shouldn't actually happen... */ 151 if (setup_count > 5) /* shouldn't actually happen... */