[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120210114541.GB6472@opensource.wolfsonmicro.com>
Date: Fri, 10 Feb 2012 11:45:42 +0000
From: Mark Brown <broonie@...nsource.wolfsonmicro.com>
To: Laxman Dewangan <ldewangan@...dia.com>
Cc: gregkh@...uxfoundation.org, linux-kernel@...r.kernel.org,
linux-tegra@...r.kernel.org
Subject: Re: [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().
Download attachment "signature.asc" of type "application/pgp-signature" (837 bytes)
Powered by blists - more mailing lists