David Miller wrote: > From: Wolfgang Grandegger <w...@grandegger.com> > Date: Thu, 21 Jan 2010 16:25:38 +0100 > >> Do you see a more clever solution to this problem? > > See how we handle this in the ESP scsi driver. We have a set of > defines for the register offsets, and a set of methods a chip driver > implements for register accesses. > > If the offsets differ, the register access method can translate the > generic register offsets into whatever layout their implementation > actually uses.
I think you speak about: void (*esp_write8)(struct esp *esp, u8 val, unsigned long reg); u8 (*esp_read8)(struct esp *esp, unsigned long reg); But still we need to translate the *generic* offset (reg) into the real offset, which requires a lookup/table to get it. For me this seems not really more efficient and less transparent as it bends the offsets. Wolfgang. _______________________________________________ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev