diff options
-rw-r--r-- | drivers/ide/pci/pdc202xx_new.c | 6 | ||||
-rw-r--r-- | drivers/ide/pci/sgiioc4.c | 8 | ||||
-rw-r--r-- | drivers/ide/pci/siimage.c | 17 | ||||
-rw-r--r-- | drivers/ide/setup-pci.c | 6 |
4 files changed, 10 insertions, 27 deletions
diff --git a/drivers/ide/pci/pdc202xx_new.c b/drivers/ide/pci/pdc202xx_new.c index a3443fce40f1..d684e713fae9 100644 --- a/drivers/ide/pci/pdc202xx_new.c +++ b/drivers/ide/pci/pdc202xx_new.c | |||
@@ -332,16 +332,12 @@ static long __devinit detect_pll_input_clock(unsigned long dma_base) | |||
332 | static void __devinit apple_kiwi_init(struct pci_dev *pdev) | 332 | static void __devinit apple_kiwi_init(struct pci_dev *pdev) |
333 | { | 333 | { |
334 | struct device_node *np = pci_device_to_OF_node(pdev); | 334 | struct device_node *np = pci_device_to_OF_node(pdev); |
335 | unsigned int class_rev = 0; | ||
336 | u8 conf; | 335 | u8 conf; |
337 | 336 | ||
338 | if (np == NULL || !of_device_is_compatible(np, "kiwi-root")) | 337 | if (np == NULL || !of_device_is_compatible(np, "kiwi-root")) |
339 | return; | 338 | return; |
340 | 339 | ||
341 | pci_read_config_dword(pdev, PCI_CLASS_REVISION, &class_rev); | 340 | if (pdev->revision >= 0x03) { |
342 | class_rev &= 0xff; | ||
343 | |||
344 | if (class_rev >= 0x03) { | ||
345 | /* Setup chip magic config stuff (from darwin) */ | 341 | /* Setup chip magic config stuff (from darwin) */ |
346 | pci_read_config_byte (pdev, 0x40, &conf); | 342 | pci_read_config_byte (pdev, 0x40, &conf); |
347 | pci_write_config_byte(pdev, 0x40, (conf | 0x01)); | 343 | pci_write_config_byte(pdev, 0x40, (conf | 0x01)); |
diff --git a/drivers/ide/pci/sgiioc4.c b/drivers/ide/pci/sgiioc4.c index b0cf6add691d..5af74ea1d46e 100644 --- a/drivers/ide/pci/sgiioc4.c +++ b/drivers/ide/pci/sgiioc4.c | |||
@@ -691,14 +691,12 @@ sgiioc4_ide_setup_pci_device(struct pci_dev *dev) | |||
691 | static unsigned int __devinit | 691 | static unsigned int __devinit |
692 | pci_init_sgiioc4(struct pci_dev *dev) | 692 | pci_init_sgiioc4(struct pci_dev *dev) |
693 | { | 693 | { |
694 | unsigned int class_rev; | ||
695 | int ret; | 694 | int ret; |
696 | 695 | ||
697 | pci_read_config_dword(dev, PCI_CLASS_REVISION, &class_rev); | ||
698 | class_rev &= 0xff; | ||
699 | printk(KERN_INFO "%s: IDE controller at PCI slot %s, revision %d\n", | 696 | printk(KERN_INFO "%s: IDE controller at PCI slot %s, revision %d\n", |
700 | DRV_NAME, pci_name(dev), class_rev); | 697 | DRV_NAME, pci_name(dev), dev->revision); |
701 | if (class_rev < IOC4_SUPPORTED_FIRMWARE_REV) { | 698 | |
699 | if (dev->revision < IOC4_SUPPORTED_FIRMWARE_REV) { | ||
702 | printk(KERN_ERR "Skipping %s IDE controller in slot %s: " | 700 | printk(KERN_ERR "Skipping %s IDE controller in slot %s: " |
703 | "firmware is obsolete - please upgrade to " | 701 | "firmware is obsolete - please upgrade to " |
704 | "revision46 or higher\n", | 702 | "revision46 or higher\n", |
diff --git a/drivers/ide/pci/siimage.c b/drivers/ide/pci/siimage.c index eda11050a02d..faf0be31ba57 100644 --- a/drivers/ide/pci/siimage.c +++ b/drivers/ide/pci/siimage.c | |||
@@ -640,13 +640,9 @@ static unsigned int setup_mmio_siimage (struct pci_dev *dev, const char *name) | |||
640 | 640 | ||
641 | static unsigned int __devinit init_chipset_siimage(struct pci_dev *dev, const char *name) | 641 | static unsigned int __devinit init_chipset_siimage(struct pci_dev *dev, const char *name) |
642 | { | 642 | { |
643 | u32 class_rev = 0; | 643 | u8 rev = dev->revision, tmpbyte = 0, BA5_EN = 0; |
644 | u8 tmpbyte = 0; | ||
645 | u8 BA5_EN = 0; | ||
646 | 644 | ||
647 | pci_read_config_dword(dev, PCI_CLASS_REVISION, &class_rev); | 645 | pci_write_config_byte(dev, PCI_CACHE_LINE_SIZE, rev ? 1 : 255); |
648 | class_rev &= 0xff; | ||
649 | pci_write_config_byte(dev, PCI_CACHE_LINE_SIZE, (class_rev) ? 1 : 255); | ||
650 | 646 | ||
651 | pci_read_config_byte(dev, 0x8A, &BA5_EN); | 647 | pci_read_config_byte(dev, 0x8A, &BA5_EN); |
652 | if ((BA5_EN & 0x01) || (pci_resource_start(dev, 5))) { | 648 | if ((BA5_EN & 0x01) || (pci_resource_start(dev, 5))) { |
@@ -825,19 +821,14 @@ static void __devinit siimage_fixup(ide_hwif_t *hwif) | |||
825 | 821 | ||
826 | static void __devinit init_iops_siimage(ide_hwif_t *hwif) | 822 | static void __devinit init_iops_siimage(ide_hwif_t *hwif) |
827 | { | 823 | { |
828 | struct pci_dev *dev = hwif->pci_dev; | ||
829 | u32 class_rev = 0; | ||
830 | |||
831 | pci_read_config_dword(dev, PCI_CLASS_REVISION, &class_rev); | ||
832 | class_rev &= 0xff; | ||
833 | |||
834 | hwif->hwif_data = NULL; | 824 | hwif->hwif_data = NULL; |
835 | 825 | ||
836 | /* Pessimal until we finish probing */ | 826 | /* Pessimal until we finish probing */ |
837 | hwif->rqsize = 15; | 827 | hwif->rqsize = 15; |
838 | 828 | ||
839 | if (pci_get_drvdata(dev) == NULL) | 829 | if (pci_get_drvdata(hwif->pci_dev) == NULL) |
840 | return; | 830 | return; |
831 | |||
841 | init_mmio_iops_siimage(hwif); | 832 | init_mmio_iops_siimage(hwif); |
842 | } | 833 | } |
843 | 834 | ||
diff --git a/drivers/ide/setup-pci.c b/drivers/ide/setup-pci.c index 51b1a9b23a22..f187889de70f 100644 --- a/drivers/ide/setup-pci.c +++ b/drivers/ide/setup-pci.c | |||
@@ -478,7 +478,6 @@ static void ide_hwif_setup_dma(struct pci_dev *dev, ide_pci_device_t *d, ide_hwi | |||
478 | static int ide_setup_pci_controller(struct pci_dev *dev, ide_pci_device_t *d, int noisy, int *config) | 478 | static int ide_setup_pci_controller(struct pci_dev *dev, ide_pci_device_t *d, int noisy, int *config) |
479 | { | 479 | { |
480 | int ret; | 480 | int ret; |
481 | u32 class_rev; | ||
482 | u16 pcicmd; | 481 | u16 pcicmd; |
483 | 482 | ||
484 | if (noisy) | 483 | if (noisy) |
@@ -501,10 +500,9 @@ static int ide_setup_pci_controller(struct pci_dev *dev, ide_pci_device_t *d, in | |||
501 | printk(KERN_INFO "%s: device enabled (Linux)\n", d->name); | 500 | printk(KERN_INFO "%s: device enabled (Linux)\n", d->name); |
502 | } | 501 | } |
503 | 502 | ||
504 | pci_read_config_dword(dev, PCI_CLASS_REVISION, &class_rev); | ||
505 | class_rev &= 0xff; | ||
506 | if (noisy) | 503 | if (noisy) |
507 | printk(KERN_INFO "%s: chipset revision %d\n", d->name, class_rev); | 504 | printk(KERN_INFO "%s: chipset revision %d\n", |
505 | d->name, dev->revision); | ||
508 | out: | 506 | out: |
509 | return ret; | 507 | return ret; |
510 | } | 508 | } |