public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] regmap: Check readable regs in _regmap_read
@ 2014-02-10 10:46 Michal Simek
  2014-02-10 10:53 ` Lars-Peter Clausen
  0 siblings, 1 reply; 5+ messages in thread
From: Michal Simek @ 2014-02-10 10:46 UTC (permalink / raw)
  To: linux-kernel, monstr; +Cc: Arnd Bergmann, Mark Brown, Greg Kroah-Hartman

[-- Attachment #1: Type: text/plain, Size: 597 bytes --]

Check if regs are readable.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---

 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..7569dfc 100644
--- a/drivers/base/regmap/regmap.c
+++ b/drivers/base/regmap/regmap.c
@@ -1725,6 +1725,9 @@ static int _regmap_read(struct regmap *map, unsigned int reg,
 	int ret;
 	void *context = _regmap_map_get_context(map);

+	if (!regmap_readable(map, reg))
+		return -EIO;
+
 	WARN_ON(!map->reg_read);

 	if (!map->cache_bypass) {
--
1.8.2.3


[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

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

end of thread, other threads:[~2014-02-10 11:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-10 10:46 [PATCH] regmap: Check readable regs in _regmap_read Michal Simek
2014-02-10 10:53 ` Lars-Peter Clausen
2014-02-10 11:00   ` Michal Simek
2014-02-10 11:49   ` Mark Brown
2014-02-10 11:54     ` Michal Simek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox