alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] regmap: Return an error if a caller attempts to do an unsupported raw read
@ 2016-02-01 21:38 Mark Brown
  2016-02-01 21:38 ` [PATCH 2/2] regmap: cache: Fall back to register by register read for cache defaults Mark Brown
  2016-02-22  3:15 ` Applied "regmap: Return an error if a caller attempts to do an unsupported raw read" to the asoc tree Mark Brown
  0 siblings, 2 replies; 8+ messages in thread
From: Mark Brown @ 2016-02-01 21:38 UTC (permalink / raw)
  To: mail, Fabio Estevam; +Cc: alsa-devel, nicoleotsuka, linux-kernel, Mark Brown

regmaps without raw I/O access can't implement raw I/O operations,
return an error if someone tries to do that rather than crashing.

Signed-off-by: Mark Brown <broonie@kernel.org>
---
 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 343263449aff..e2f68807d970 100644
--- a/drivers/base/regmap/regmap.c
+++ b/drivers/base/regmap/regmap.c
@@ -2255,6 +2255,9 @@ static int _regmap_raw_read(struct regmap *map, unsigned int reg, void *val,
 
 	WARN_ON(!map->bus);
 
+	if (!map->bus || !map->bus->read)
+		return -EINVAL;
+
 	range = _regmap_range_lookup(map, reg);
 	if (range) {
 		ret = _regmap_select_page(map, &reg, range,
-- 
2.7.0.rc3

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

end of thread, other threads:[~2016-02-22  3:15 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-01 21:38 [PATCH 1/2] regmap: Return an error if a caller attempts to do an unsupported raw read Mark Brown
2016-02-01 21:38 ` [PATCH 2/2] regmap: cache: Fall back to register by register read for cache defaults Mark Brown
2016-02-01 21:41   ` Mark Brown
2016-02-01 21:58     ` Fabio Estevam
2016-02-01 22:13       ` Mark Brown
2016-02-01 22:54         ` Maciej S. Szmigiero
2016-02-01 23:58           ` Fabio Estevam
2016-02-22  3:15 ` Applied "regmap: Return an error if a caller attempts to do an unsupported raw read" to the asoc tree Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).