static int bcm53000_pci_write_config(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 value) { unsigned long flags; int ret; u8 val8; u16 val16; u32 *pval; spin_lock_irqsave(&sih_lock, flags); if (size == 1) { val8 = value; pval = &val8; } else if (size == 2) { val16 = value; pval = &val16; } else { pval = &value; } ret = hndpci_write_config(sih, bus->number, PCI_SLOT(devfn), PCI_FUNC(devfn), where, pval, size); spin_unlock_irqrestore(&sih_lock, flags); return ret ? PCIBIOS_DEVICE_NOT_FOUND : PCIBIOS_SUCCESSFUL; }
static int sbpci_write_config_reg(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 value) { unsigned long flags; int ret; spin_lock_irqsave(&sih_lock, flags); ret = hndpci_write_config(sih, bus->number, PCI_SLOT(devfn), PCI_FUNC(devfn), where, &value, size); spin_unlock_irqrestore(&sih_lock, flags); return ret ? PCIBIOS_DEVICE_NOT_FOUND : PCIBIOS_SUCCESSFUL; }