* [PATCH v2] regmap: Check readable regs in _regmap_read
@ 2014-02-10 11:59 Michal Simek
2014-02-11 16:39 ` Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: Michal Simek @ 2014-02-10 11:59 UTC (permalink / raw)
To: linux-kernel, monstr
Cc: Arnd Bergmann, Lars-Peter Clausen, Mark Brown, Greg Kroah-Hartman
[-- Attachment #1: Type: text/plain, Size: 651 bytes --]
Check if regs are readable.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---
Changes in v2:
- Move checking below cache read
drivers/base/regmap/regmap.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c
index 6a19515..b897c1a 100644
--- a/drivers/base/regmap/regmap.c
+++ b/drivers/base/regmap/regmap.c
@@ -1736,6 +1736,9 @@ static int _regmap_read(struct regmap *map, unsigned int reg,
if (map->cache_only)
return -EBUSY;
+ if (!regmap_readable(map, reg))
+ return -EIO;
+
ret = map->reg_read(context, reg, val);
if (ret == 0) {
#ifdef LOG_DEVICE
--
1.8.2.3
[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH v2] regmap: Check readable regs in _regmap_read
2014-02-10 11:59 [PATCH v2] regmap: Check readable regs in _regmap_read Michal Simek
@ 2014-02-11 16:39 ` Mark Brown
0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2014-02-11 16:39 UTC (permalink / raw)
To: Michal Simek
Cc: linux-kernel, monstr, Arnd Bergmann, Lars-Peter Clausen,
Greg Kroah-Hartman
[-- Attachment #1: Type: text/plain, Size: 110 bytes --]
On Mon, Feb 10, 2014 at 12:59:46PM +0100, Michal Simek wrote:
> Check if regs are readable.
Applied, thanks.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-02-11 16:39 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-10 11:59 [PATCH v2] regmap: Check readable regs in _regmap_read Michal Simek
2014-02-11 16:39 ` Mark Brown
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®