/* 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 msc_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 msc_pcibios_read(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 *val)
{
	u32 data = 0;
	if ((size == 2) && (where & 1))
		return PCIBIOS_BAD_REGISTER_NUMBER;
	else if ((size == 4) && (where & 3))
		return PCIBIOS_BAD_REGISTER_NUMBER;
	if (msc_pcibios_config_access(PCI_ACCESS_READ, bus, devfn, where,
	                              &data))
		return -1;
	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;
}