ide/ide-cs: fix order of releasing resources
[safe/jmp/linux-2.6] / drivers / ide / icside.c
index c5269fa..d7e6f09 100644 (file)
@@ -236,7 +236,8 @@ static const struct ide_port_ops icside_v6_no_dma_port_ops = {
  */
 static void icside_set_dma_mode(ide_drive_t *drive, const u8 xfer_mode)
 {
-       int cycle_time, use_dma_info = 0;
+       unsigned long cycle_time;
+       int use_dma_info = 0;
 
        switch (xfer_mode) {
        case XFER_MW_DMA_2:
@@ -267,10 +268,11 @@ static void icside_set_dma_mode(ide_drive_t *drive, const u8 xfer_mode)
        if (use_dma_info && drive->id[ATA_ID_EIDE_DMA_TIME] > cycle_time)
                cycle_time = drive->id[ATA_ID_EIDE_DMA_TIME];
 
-       drive->drive_data = cycle_time;
+       ide_set_drivedata(drive, (void *)cycle_time);
 
        printk("%s: %s selected (peak %dMB/s)\n", drive->name,
-               ide_xfer_verbose(xfer_mode), 2000 / drive->drive_data);
+               ide_xfer_verbose(xfer_mode),
+               2000 / (unsigned long)ide_get_drivedata(drive));
 }
 
 static const struct ide_port_ops icside_v6_port_ops = {
@@ -332,7 +334,7 @@ static int icside_dma_setup(ide_drive_t *drive, struct ide_cmd *cmd)
        /*
         * Select the correct timing for this drive.
         */
-       set_dma_speed(ec->dma, drive->drive_data);
+       set_dma_speed(ec->dma, (unsigned long)ide_get_drivedata(drive));
 
        /*
         * Tell the DMA engine about the SG table and