All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] regmap: fix return value in regcache-indexed read call.
@ 2011-12-21 15:48 Michael Williamson
  2011-12-21 16:41 ` Michael Williamson
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Williamson @ 2011-12-21 15:48 UTC (permalink / raw)
  To: linux-kernel; +Cc: Michael Williamson, broonie, gregkh

The regcache_read() API for regmap requires a 0 return value for
successful cached reads.  The read method for the indexed type
cache implementation is returning the positive map offset for a
successful read, which is incorrect.  Fix it.

Signed-off-by: Michael Williamson <michael.williamson@criticallink.com>
---
 drivers/base/regmap/regcache-indexed.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/base/regmap/regcache-indexed.c b/drivers/base/regmap/regcache-indexed.c
index 507731a..ade5b8c 100644
--- a/drivers/base/regmap/regcache-indexed.c
+++ b/drivers/base/regmap/regcache-indexed.c
@@ -22,8 +22,10 @@ static int regcache_indexed_read(struct regmap *map, unsigned int reg,
 	ret = regcache_lookup_reg(map, reg);
 	if (ret >= 0)
 		*value = map->reg_defaults[ret].def;
+	else
+		return ret;
 
-	return ret;
+	return 0;
 }
 
 static int regcache_indexed_write(struct regmap *map, unsigned int reg,
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] regmap: fix return value in regcache-indexed read call.
  2011-12-21 15:48 [PATCH] regmap: fix return value in regcache-indexed read call Michael Williamson
@ 2011-12-21 16:41 ` Michael Williamson
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Williamson @ 2011-12-21 16:41 UTC (permalink / raw)
  To: Michael Williamson; +Cc: linux-kernel, broonie, gregkh

On 12/21/2011 10:48 AM, Michael Williamson wrote:
> The regcache_read() API for regmap requires a 0 return value for
> successful cached reads.  The read method for the indexed type
> cache implementation is returning the positive map offset for a
> successful read, which is incorrect.  Fix it.
>
[...]

Looks like this cache type is due to be removed in linux-next.  Please
withdraw.  Thanks.

http://permalink.gmane.org/gmane.linux.kernel/1217338

-Mike

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-12-21 16:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-21 15:48 [PATCH] regmap: fix return value in regcache-indexed read call Michael Williamson
2011-12-21 16:41 ` Michael Williamson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.