aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/icside.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/icside.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/icside.c')
-rw-r--r--drivers/ide/icside.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/ide/icside.c b/drivers/ide/icside.c
index 5af3d0ffaf0a..0f67f1abbbd3 100644
--- a/drivers/ide/icside.c
+++ b/drivers/ide/icside.c
@@ -187,7 +187,8 @@ static const expansioncard_ops_t icside_ops_arcin_v6 = {
187 */ 187 */
188static void icside_set_dma_mode(ide_drive_t *drive, const u8 xfer_mode) 188static void icside_set_dma_mode(ide_drive_t *drive, const u8 xfer_mode)
189{ 189{
190 int cycle_time, use_dma_info = 0; 190 unsigned long cycle_time;
191 int use_dma_info = 0;
191 192
192 switch (xfer_mode) { 193 switch (xfer_mode) {
193 case XFER_MW_DMA_2: 194 case XFER_MW_DMA_2:
@@ -218,10 +219,11 @@ static void icside_set_dma_mode(ide_drive_t *drive, const u8 xfer_mode)
218 if (use_dma_info && drive->id[ATA_ID_EIDE_DMA_TIME] > cycle_time) 219 if (use_dma_info && drive->id[ATA_ID_EIDE_DMA_TIME] > cycle_time)
219 cycle_time = drive->id[ATA_ID_EIDE_DMA_TIME]; 220 cycle_time = drive->id[ATA_ID_EIDE_DMA_TIME];
220 221
221 drive->drive_data = cycle_time; 222 ide_set_drivedata(drive, (void *)cycle_time);
222 223
223 printk("%s: %s selected (peak %dMB/s)\n", drive->name, 224 printk("%s: %s selected (peak %dMB/s)\n", drive->name,
224 ide_xfer_verbose(xfer_mode), 2000 / drive->drive_data); 225 ide_xfer_verbose(xfer_mode),
226 2000 / (unsigned long)ide_get_drivedata(drive));
225} 227}
226 228
227static const struct ide_port_ops icside_v6_port_ops = { 229static const struct ide_port_ops icside_v6_port_ops = {
@@ -277,7 +279,7 @@ static int icside_dma_setup(ide_drive_t *drive, struct ide_cmd *cmd)
277 /* 279 /*
278 * Select the correct timing for this drive. 280 * Select the correct timing for this drive.
279 */ 281 */
280 set_dma_speed(ec->dma, drive->drive_data); 282 set_dma_speed(ec->dma, (unsigned long)ide_get_drivedata(drive));
281 283
282 /* 284 /*
283 * Tell the DMA engine about the SG table and 285 * Tell the DMA engine about the SG table and