]> Pileus Git - ~andy/linux/blobdiff - arch/x86/pci/early.c
PCI/x86: write_pci_config_byte fix offset
[~andy/linux] / arch / x86 / pci / early.c
index 42df4b6606dfdbc6f21d2cce0cbb6e8ae3e3ea42..8e2821e8dac5aa78c13e31f3eac26b6962fad737 100644 (file)
@@ -49,7 +49,14 @@ void write_pci_config_byte(u8 bus, u8 slot, u8 func, u8 offset, u8 val)
 {
        PDprintk("%x writing to %x: %x\n", slot, offset, val);
        outl(0x80000000 | (bus<<16) | (slot<<11) | (func<<8) | offset, 0xcf8);
-       outb(val, 0xcfc);
+       outb(val, 0xcfc + (offset&3));
+}
+
+void write_pci_config_16(u8 bus, u8 slot, u8 func, u8 offset, u16 val)
+{
+       PDprintk("%x writing to %x: %x\n", slot, offset, val);
+       outl(0x80000000 | (bus<<16) | (slot<<11) | (func<<8) | offset, 0xcf8);
+       outw(val, 0xcfc + (offset&2));
 }
 
 int early_pci_allowed(void)