]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - drivers/ide/pci/hpt34x.c
ide: use PCI_VDEVICE() macro
[mirror_ubuntu-bionic-kernel.git] / drivers / ide / pci / hpt34x.c
index a1bb10188fe54da2e84b190745b009083305aea7..88472e5a3ec7a3f43ff02685701ed80483de8496 100644 (file)
@@ -43,7 +43,7 @@
 
 #define HPT343_DEBUG_DRIVE_INFO                0
 
-static int hpt34x_tune_chipset(ide_drive_t *drive, const u8 speed)
+static void hpt34x_set_mode(ide_drive_t *drive, const u8 speed)
 {
        struct pci_dev *dev     = HWIF(drive)->pci_dev;
        u32 reg1= 0, tmp1 = 0, reg2 = 0, tmp2 = 0;
@@ -73,26 +73,11 @@ static int hpt34x_tune_chipset(ide_drive_t *drive, const u8 speed)
                drive->dn, reg1, tmp1, reg2, tmp2,
                hi_speed, lo_speed);
 #endif /* HPT343_DEBUG_DRIVE_INFO */
-
-       return(ide_config_drive_speed(drive, speed));
 }
 
 static void hpt34x_set_pio_mode(ide_drive_t *drive, const u8 pio)
 {
-       (void) hpt34x_tune_chipset(drive, (XFER_PIO_0 + pio));
-}
-
-static int hpt34x_config_drive_xfer_rate (ide_drive_t *drive)
-{
-       drive->init_speed = 0;
-
-       if (ide_tune_dma(drive))
-               return -1;
-
-       if (ide_use_fast_pio(drive))
-               ide_set_max_pio(drive);
-
-       return -1;
+       hpt34x_set_mode(drive, XFER_PIO_0 + pio);
 }
 
 /*
@@ -145,7 +130,8 @@ static void __devinit init_hwif_hpt34x(ide_hwif_t *hwif)
        hwif->autodma = 0;
 
        hwif->set_pio_mode = &hpt34x_set_pio_mode;
-       hwif->speedproc = &hpt34x_tune_chipset;
+       hwif->set_dma_mode = &hpt34x_set_mode;
+
        hwif->drives[0].autotune = 1;
        hwif->drives[1].autotune = 1;
 
@@ -160,7 +146,6 @@ static void __devinit init_hwif_hpt34x(ide_hwif_t *hwif)
        hwif->swdma_mask = 0x07;
 #endif
 
-       hwif->ide_dma_check = &hpt34x_config_drive_xfer_rate;
        if (!noautodma)
                hwif->autodma = (pcicmd & PCI_COMMAND_MEMORY) ? 1 : 0;
        hwif->drives[0].autodma = hwif->autodma;
@@ -191,8 +176,8 @@ static int __devinit hpt34x_init_one(struct pci_dev *dev, const struct pci_devic
        return ide_setup_pci_device(dev, d);
 }
 
-static struct pci_device_id hpt34x_pci_tbl[] = {
-       { PCI_VENDOR_ID_TTI, PCI_DEVICE_ID_TTI_HPT343, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
+static const struct pci_device_id hpt34x_pci_tbl[] = {
+       { PCI_VDEVICE(TTI, PCI_DEVICE_ID_TTI_HPT343), 0 },
        { 0, },
 };
 MODULE_DEVICE_TABLE(pci, hpt34x_pci_tbl);