libata: straighten out ATA_ID_* constants
[powerpc.git] / drivers / ata / pata_ali.c
index ae6d573..76e3860 100644 (file)
@@ -34,7 +34,7 @@
 #include <linux/dmi.h>
 
 #define DRV_NAME "pata_ali"
-#define DRV_VERSION "0.7.1"
+#define DRV_VERSION "0.7.2"
 
 /*
  *     Cable special cases
@@ -153,11 +153,11 @@ static void ali_early_error_handler(struct ata_port *ap)
 
 static unsigned long ali_20_filter(const struct ata_port *ap, struct ata_device *adev, unsigned long mask)
 {
-       char model_num[40];
+       char model_num[ATA_ID_PROD_LEN];
        /* No DMA on anything but a disk for now */
        if (adev->class != ATA_DEV_ATA)
                mask &= ~(ATA_MASK_MWDMA | ATA_MASK_UDMA);
-       ata_id_string(adev->id, model_num, ATA_ID_PROD_OFS, sizeof(model_num));
+       ata_id_string(adev->id, model_num, ATA_ID_PROD, sizeof(model_num));
        if (strstr(model_num, "WDC"))
                return mask &= ~ATA_MASK_UDMA;
        return ata_pci_default_filter(ap, adev, mask);
@@ -337,9 +337,6 @@ static struct scsi_host_template ali_sht = {
        .can_queue              = ATA_DEF_QUEUE,
        .this_id                = ATA_SHT_THIS_ID,
        .sg_tablesize           = LIBATA_MAX_PRD,
-       /* Keep LBA28 counts so large I/O's don't turn LBA48 and PIO
-          with older controllers. Not locked so will grow on C5 or later */
-       .max_sectors            = 255,
        .cmd_per_lun            = ATA_SHT_CMD_PER_LUN,
        .emulated               = ATA_SHT_EMULATED,
        .use_clustering         = ATA_SHT_USE_CLUSTERING,
@@ -507,7 +504,7 @@ static struct ata_port_operations ali_c5_port_ops = {
  *     Perform the setup on the device that must be done both at boot
  *     and at resume time.
  */
+
 static void ali_init_chipset(struct pci_dev *pdev)
 {
        u8 rev, tmp;
@@ -531,7 +528,7 @@ static void ali_init_chipset(struct pci_dev *pdev)
                pci_read_config_byte(pdev, 0x4B, &tmp);
                pci_write_config_byte(pdev, 0x4B, tmp | 0x08);
        }
-       north = pci_get_slot(pdev->bus, PCI_DEVFN(0,0));
+       north = pci_get_bus_and_slot(0, PCI_DEVFN(0,0));
        isa_bridge = pci_get_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1533, NULL);
 
        if (north && north->vendor == PCI_VENDOR_ID_AL && isa_bridge) {
@@ -540,7 +537,7 @@ static void ali_init_chipset(struct pci_dev *pdev)
                pci_read_config_byte(isa_bridge, 0x79, &tmp);
                if (rev == 0xC2)
                        pci_write_config_byte(isa_bridge, 0x79, tmp | 0x04);
-               else if (rev > 0xC2)
+               else if (rev > 0xC2 && rev < 0xC5)
                        pci_write_config_byte(isa_bridge, 0x79, tmp | 0x02);
        }
        if (rev >= 0x20) {
@@ -658,7 +655,7 @@ static int ali_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
                port_info[0] = port_info[1] = &info_c5;
 
        ali_init_chipset(pdev);
-       
+
        isa_bridge = pci_get_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1533, NULL);
        if (isa_bridge && rev >= 0x20 && rev < 0xC2) {
                /* Are we paired with a UDMA capable chip */