lkml.org 
[lkml]   [2012]   [Feb]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH V1] regmap: Support for caching in reg_raw_write()
On Fri, Feb 10, 2012 at 05:02:52PM +0530, Laxman Dewangan wrote:

This looks good, but could you make the few small improvements below
please?

> + if (!map->cache_bypass && map->format.parse_val) {
> + int val_bytes = map->format.val_bytes;
> + unsigned int ival;
> + for (i = 0; i < val_len / map->format.val_bytes; i++) {

A bit nit picky but since you've got a local val_bytes you may as well
use it.

> + memcpy(map->work_buf, val + (i * val_bytes), val_bytes);
> + ival = map->format.parse_val(map->work_buf);
> + ret = regcache_write(map, reg + i, ival);
> + if (ret) {
> + dev_warn(map->dev,
> + "Error in caching of register\n");

Say which register and the return value here - knowing the register
might be very helpful for debug. This should probably also be at least
a dev_err().
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2012-02-10 12:49    [W:0.043 / U:4.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site