/* We can't address 8 and 16 bit words directly. Instead we have to read/write a 32bit word and mask/modify the data we actually want.  */
static int gt64xxx_pci0_pcibios_read(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 *val)
/* We can't address 8 and 16 bit words directly. Instead we have to read/write a 32bit word and mask/modify the data we actually want.  */
static int gt64xxx_pci0_pcibios_read(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 *val)
{
	u32 data = 0;
	if (gt64xxx_pci0_pcibios_config_access(PCI_ACCESS_READ, bus, devfn,
	                                       where, &data))
		return PCIBIOS_DEVICE_NOT_FOUND;
	if (size == 1)
		*val = (data >> ((where & 3) << 3)) & 0xff;
	else if (size == 2)
		*val = (data >> ((where & 3) << 3)) & 0xffff;
	else
		*val = data;
	return PCIBIOS_SUCCESSFUL;
}