From c54ab72b927a9deada0293edb8b80df0b84a3d61 Mon Sep 17 00:00:00 2001 From: mav Date: Wed, 21 Oct 2015 17:27:43 +0000 Subject: [PATCH] Pass proper device to pci_read_config(). For some reason JMicron driver was different from others at this point. --- sys/dev/ata/chipsets/ata-jmicron.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/dev/ata/chipsets/ata-jmicron.c b/sys/dev/ata/chipsets/ata-jmicron.c index 498c16e93e5e..5eb9ae8a7e7e 100644 --- a/sys/dev/ata/chipsets/ata-jmicron.c +++ b/sys/dev/ata/chipsets/ata-jmicron.c @@ -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; }