Linus, I think I'm getting what you're aiming for here. See if this patch comes close to what you're looking for. The basic idea is we get rid of the byte/word/dword functions and just put a size arg in the generic calls. I put back the different struct pci_ops for conf1 and conf2, so that drivers and other code could use either config option. I also fixed the macros in access.h so that it correctly calls the new functions. Please *don't* apply this as it will break a bunch of stuff (just about all PCI code ;) Cheers! -Matt Linus Torvalds wrote: > On 13 Aug 2002, Alan Cox wrote: > >>>OK, that IDE thing smacks of unmitigated evil to me, but if things are relying >>>on it, we shouldn't change it. >> >>It wants to force its own conf1/conf2 over the BIOS even if BIOS is >>preferred because some BIOSes dont honour the size requested and the >>hardware has bugs. >> >>That to me says there may well be cleaner approaches. > > > The thing I liked about the separate structures for function pointers for > conf1/conf2 is that I could at least _see_ that the IDE driver might some > day be changed to just do > > .. > conf2_struct->pci_config_read_byte(..) > .. > > even if (judging by past performance) this would never happen ;) > > This is why I'd like to continue with the notion of having a well-defined > structure that contains all the pointers (and one default case). Now, > shrinking those structures down to 2 entries instead of 6 sounds like a > fine idea to me, but short-circuiting them internally sounds bad because > it loses the ability to use the pci config space functions independently > of each other. > > Linus > >