From: Lars-Peter Clausen <lars@metafoo.de>
To: Michal Simek <michal.simek@xilinx.com>
Cc: linux-kernel@vger.kernel.org, monstr@monstr.eu,
Arnd Bergmann <arnd@arndb.de>, Mark Brown <broonie@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: Re: [PATCH] regmap: Check readable regs in _regmap_read
Date: Mon, 10 Feb 2014 11:53:38 +0100 [thread overview]
Message-ID: <52F8AFB2.4000307@metafoo.de> (raw)
In-Reply-To: <73e82a7cf77a1a68c5303def3071418b7d0ea382.1392029156.git.michal.simek@xilinx.com>
On 02/10/2014 11:46 AM, Michal Simek wrote:
> 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;
> +
This will cause issues with devices where registers are writable, but not
readable, but we keep the register value in the cache.
> WARN_ON(!map->reg_read);
>
> if (!map->cache_bypass) {
> --
> 1.8.2.3
>
next prev parent reply other threads:[~2014-02-10 10:53 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-10 10:46 [PATCH] regmap: Check readable regs in _regmap_read Michal Simek
2014-02-10 10:53 ` Lars-Peter Clausen [this message]
2014-02-10 11:00 ` Michal Simek
2014-02-10 11:49 ` Mark Brown
2014-02-10 11:54 ` Michal Simek
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=52F8AFB2.4000307@metafoo.de \
--to=lars@metafoo.de \
--cc=arnd@arndb.de \
--cc=broonie@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michal.simek@xilinx.com \
--cc=monstr@monstr.eu \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.