Re: [PATCH] ARM: OMAP: Add minimal OMAP2430 support

Juha Yrjölä
2006-06-11T12:50:36Z

Woodruff, Richard wrote:

> I picked up this encoding from USB which uses it also. In general it
> makes any kind of porting and sharing between some of our internal code
> bases easier. It has a nice property of also being more compact (in C
> file coding space) then other forms.

That encoding has a lot of downsides:

- You're tied to accessing only one instance of the peripheral (trying
to access e.g. the different GPIO blocks is bound to be ugly).
- You're tied to MMIO. read_reg/write_reg can basically use whatever
transport.
- As mentioned before, supporting several base addresses (e.g. on
different OMAPs) becomes a hassle.

read_reg/write_reg, in my opinion, doesn't. You mention compactness as
one, but with some preprocessor trickery it's rather easy to come up
with a very compact read_reg/write_reg notation.

But all in all, this is mostly a readability issue, and therefore
subject to personal preferences. Mine is read_reg/write_reg. =)

Cheers,
Juha