From: Fabio Estevam <festevam@gmail.com>
To: broonie@kernel.org
Cc: mail@maciej.szmigiero.name, linux-kernel@vger.kernel.org,
Fabio Estevam <fabio.estevam@nxp.com>
Subject: [PATCH 1/2] regmap: Return an error if a caller attempts to do an unsupported raw read
Date: Tue, 2 Feb 2016 10:16:50 -0200 [thread overview]
Message-ID: <1454415411-14404-1-git-send-email-festevam@gmail.com> (raw)
From: Mark Brown <broonie@kernel.org>
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>
Signed-off-by: Fabio Estevam <fabio.estevam@nxp.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 3432634..e2f6880 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, ®, range,
--
1.9.1
next reply other threads:[~2016-02-02 12:17 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-02 12:16 Fabio Estevam [this message]
2016-02-02 12:16 ` [PATCH 2/2] regmap: cache: Fall back to register by register read for cache defaults Fabio Estevam
2016-02-02 12:28 ` [PATCH 1/2] regmap: Return an error if a caller attempts to do an unsupported raw read Mark Brown
-- strict thread matches above, loose matches on Subject: below --
2016-02-01 21:38 Mark Brown
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=1454415411-14404-1-git-send-email-festevam@gmail.com \
--to=festevam@gmail.com \
--cc=broonie@kernel.org \
--cc=fabio.estevam@nxp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mail@maciej.szmigiero.name \
/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;
as well as URLs for NNTP newsgroup(s).