cy82c693: add ->remove method and module_exit()
[safe/jmp/linux-2.6] / drivers / ide / legacy / ali14xx.c
index 7bfb28e..4ec1973 100644 (file)
@@ -49,6 +49,8 @@
 
 #include <asm/io.h>
 
+#define DRV_NAME "ali14xx"
+
 /* port addresses for auto-detection */
 #define ALI_NUM_PORTS 4
 static const int ports[ALI_NUM_PORTS] __initdata =
@@ -114,11 +116,12 @@ static void ali14xx_set_pio_mode(ide_drive_t *drive, const u8 pio)
        int time1, time2;
        u8 param1, param2, param3, param4;
        unsigned long flags;
-       int bus_speed = system_bus_clock();
+       int bus_speed = ide_vlb_clk ? ide_vlb_clk : 50;
+       struct ide_timing *t = ide_timing_find_mode(XFER_PIO_0 + pio);
 
        /* calculate timing, according to PIO mode */
        time1 = ide_pio_cycle_time(drive, pio);
-       time2 = ide_pio_timings[pio].active_time;
+       time2 = t->active;
        param3 = param1 = (time2 * bus_speed + 999) / 1000;
        param4 = param2 = (time1 * bus_speed + 999) / 1000 - param1;
        if (pio < 3) {
@@ -197,9 +200,10 @@ static const struct ide_port_ops ali14xx_port_ops = {
 };
 
 static const struct ide_port_info ali14xx_port_info = {
+       .name                   = DRV_NAME,
        .chipset                = ide_ali14xx,
        .port_ops               = &ali14xx_port_ops,
-       .host_flags             = IDE_HFLAG_NO_DMA | IDE_HFLAG_NO_AUTOTUNE,
+       .host_flags             = IDE_HFLAG_NO_DMA,
        .pio_mask               = ATA_PIO4,
 };
 
@@ -217,7 +221,7 @@ static int __init ali14xx_probe(void)
        return ide_legacy_device_add(&ali14xx_port_info, 0);
 }
 
-int probe_ali14xx;
+static int probe_ali14xx;
 
 module_param_named(probe, probe_ali14xx, bool, 0);
 MODULE_PARM_DESC(probe, "probe for ALI M14xx chipsets");