Re: [PATCH 3/3] [regmap] [RESEND] Add "no-bus" option for regmap API

From: Mark Brown
Date: Sun Jan 13 2013 - 18:18:29 EST


On Sat, Jan 12, 2013 at 12:54:14PM -0800, Andrey Smirnov wrote:

> + bool cache_registers;
> +

I'm afraid I don't quite understand this...

> - if (!map->cache_bypass && map->format.format_write) {
> + if (!map->cache_bypass && map->cache_registers) {
> ret = regcache_write(map, reg, val);

...I think it's mostly to service this check here, but looking at the
code I can't quite think why the code is doing what it's doing - I
suspect we should just remove the check for format_write() here. I
think it was there to support potential bulk writes from the cache code
(which we don't do yet) but we're not actually doing those and it's not
clear that this should be doing that anyway.

> int ret;
> + void *context = (map->bus) ? map : map->bus_context;
> +

Can you please make this a static inline regmap_map_get_context() or
something? The same thing appears in quite a few places and the terery
operator isn't great at the best of times.

Otherwise this looks good, thanks a lot for doing this.

Attachment: signature.asc
Description: Digital signature