On Wed, May 27, 2009 at 05:33:37PM -0500, Anthony Liguori wrote:
pci_register_io_region(&d->dev, 0, 0x100,
PCI_ADDRESS_SPACE_IO, rtl8139_ioport_read,
rtl8139_ioport_write, s);
pci_register_io_region(&d->dev, 1, 0x100,
PCI_ADDRESS_SPACE_MEM, rtl8139_mmio_read,
rtl8139_mmio_write, s);
Moreover, you could probably drop the opaque parameter and and just use
d->dev. I hope it's possible to get from one to the other.
I also think this is a much more natural API, and would simplify drivers
a lot. As for the naming the PCI spec uses the term bar for these
PIO/MMIO regions, so maybe call it pci_register_bar or pci_setup_bar?