ide: change ->set_pio_mode method parameters
[platform/kernel/linux-starfive.git] / drivers / ide / cs5520.c
index 09f98ed..b8094f0 100644 (file)
@@ -57,11 +57,11 @@ static struct pio_clocks cs5520_pio_clocks[]={
        {1, 2, 1}
 };
 
-static void cs5520_set_pio_mode(ide_drive_t *drive, const u8 pio)
+static void cs5520_set_pio_mode(ide_hwif_t *hwif, ide_drive_t *drive)
 {
-       ide_hwif_t *hwif = drive->hwif;
        struct pci_dev *pdev = to_pci_dev(hwif->dev);
        int controller = drive->dn > 1 ? 1 : 0;
+       const u8 pio = drive->pio_mode - XFER_PIO_0;
 
        /* 8bit CAT/CRT - 8bit command timing for channel */
        pci_write_config_byte(pdev, 0x62 + controller, 
@@ -85,7 +85,8 @@ static void cs5520_set_dma_mode(ide_drive_t *drive, const u8 speed)
 {
        printk(KERN_ERR "cs55x0: bad ide timing.\n");
 
-       cs5520_set_pio_mode(drive, 0);
+       drive->pio_mode = XFER_PIO_0 + 0;
+       cs5520_set_pio_mode(drive->hwif, drive);
 }
 
 static const struct ide_port_ops cs5520_port_ops = {