Author: mav
Date: Wed Oct 21 17:27:43 2015
New Revision: 289707
URL: https://svnweb.freebsd.org/changeset/base/289707

Log:
  Pass proper device to pci_read_config().
  
  For some reason JMicron driver was different from others at this point.

Modified:
  head/sys/dev/ata/chipsets/ata-jmicron.c

Modified: head/sys/dev/ata/chipsets/ata-jmicron.c
==============================================================================
--- head/sys/dev/ata/chipsets/ata-jmicron.c     Wed Oct 21 16:32:01 2015        
(r289706)
+++ head/sys/dev/ata/chipsets/ata-jmicron.c     Wed Oct 21 17:27:43 2015        
(r289707)
@@ -142,12 +142,13 @@ ata_jmicron_ch_attach(device_t dev)
 static int
 ata_jmicron_setmode(device_t dev, int target, int mode)
 {
-       struct ata_pci_controller *ctlr = 
device_get_softc(device_get_parent(dev));
+       device_t parent = device_get_parent(dev);
+       struct ata_pci_controller *ctlr = device_get_softc(parent);
 
        mode = min(mode, ctlr->chip->max_dma);
        /* check for 80pin cable present */
        if (ata_dma_check_80pin && mode > ATA_UDMA2 &&
-           pci_read_config(dev, 0x40, 1) & 0x08) {
+           pci_read_config(parent, 0x40, 1) & 0x08) {
                ata_print_cable(dev, "controller");
                mode = ATA_UDMA2;
        }
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to