aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/qd65xx.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/qd65xx.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/qd65xx.c')
-rw-r--r--drivers/ide/qd65xx.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/ide/qd65xx.c b/drivers/ide/qd65xx.c
index c9a134986891..74696edc8d1d 100644
--- a/drivers/ide/qd65xx.c
+++ b/drivers/ide/qd65xx.c
@@ -180,8 +180,11 @@ static int qd_find_disk_type (ide_drive_t *drive,
180 180
181static void qd_set_timing (ide_drive_t *drive, u8 timing) 181static void qd_set_timing (ide_drive_t *drive, u8 timing)
182{ 182{
183 drive->drive_data &= 0xff00; 183 unsigned long data = (unsigned long)ide_get_drivedata(drive);
184 drive->drive_data |= timing; 184
185 data &= 0xff00;
186 data |= timing;
187 ide_set_drivedata(drive, (void *)data);
185 188
186 printk(KERN_DEBUG "%s: %#x\n", drive->name, timing); 189 printk(KERN_DEBUG "%s: %#x\n", drive->name, timing);
187} 190}
@@ -292,7 +295,7 @@ static void __init qd6500_init_dev(ide_drive_t *drive)
292 u8 base = (hwif->config_data & 0xff00) >> 8; 295 u8 base = (hwif->config_data & 0xff00) >> 8;
293 u8 config = QD_CONFIG(hwif); 296 u8 config = QD_CONFIG(hwif);
294 297
295 drive->drive_data = QD6500_DEF_DATA; 298 ide_set_drivedata(drive, (void *)QD6500_DEF_DATA);
296} 299}
297 300
298static void __init qd6580_init_dev(ide_drive_t *drive) 301static void __init qd6580_init_dev(ide_drive_t *drive)
@@ -308,7 +311,7 @@ static void __init qd6580_init_dev(ide_drive_t *drive)
308 } else 311 } else
309 t2 = t1 = hwif->channel ? QD6580_DEF_DATA2 : QD6580_DEF_DATA; 312 t2 = t1 = hwif->channel ? QD6580_DEF_DATA2 : QD6580_DEF_DATA;
310 313
311 drive->drive_data = (drive->dn & 1) ? t2 : t1; 314 ide_set_drivedata(drive, (void *)((drive->dn & 1) ? t2 : t1));
312} 315}
313 316
314static const struct ide_tp_ops qd65xx_tp_ops = { 317static const struct ide_tp_ops qd65xx_tp_ops = {