From: Michael Williamson <michael.williamson@criticallink.com>
To: linux-kernel@vger.kernel.org
Cc: Michael Williamson <michael.williamson@criticallink.com>,
broonie@opensource.wolfsonmicro.com, gregkh@suse.de
Subject: [PATCH] regmap: fix return value in regcache-indexed read call.
Date: Wed, 21 Dec 2011 10:48:02 -0500 [thread overview]
Message-ID: <1324482482-30889-1-git-send-email-michael.williamson@criticallink.com> (raw)
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
next reply other threads:[~2011-12-21 15:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-21 15:48 Michael Williamson [this message]
2011-12-21 16:41 ` Michael Williamson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1324482482-30889-1-git-send-email-michael.williamson@criticallink.com \
--to=michael.williamson@criticallink.com \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=gregkh@suse.de \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®