From: Michael Walle <michael@walle.cc>
To: "Álvaro Fernández Rojas" <noltari@gmail.com>
Cc: Linus Walleij <linus.walleij@linaro.org>,
Bartosz Golaszewski <bgolaszewski@baylibre.com>,
Andy Shevchenko <andy.shevchenko@gmail.com>,
linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] gpio: regmap: fix direction register check
Date: Tue, 02 Mar 2021 19:16:16 +0100 [thread overview]
Message-ID: <c05bf9228206786a09f4f17160a2edf9@walle.cc> (raw)
In-Reply-To: <20210302180621.12301-1-noltari@gmail.com>
Am 2021-03-02 19:06, schrieb Álvaro Fernández Rojas:
> If there's a direction register, we should also have dat or set
> registers.
> However, we only need one of them, not both.
Can you give some more context or an example? If there is a direction
register, we'd need to set and get the value, no?
-michael
> Fixes: ebe363197e52 ("gpio: add a reusable generic gpio_chip using
> regmap")
> Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
> ---
> drivers/gpio/gpio-regmap.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpio/gpio-regmap.c b/drivers/gpio/gpio-regmap.c
> index 23b0a8572f53..5a9fca00b5e8 100644
> --- a/drivers/gpio/gpio-regmap.c
> +++ b/drivers/gpio/gpio-regmap.c
> @@ -194,7 +194,7 @@ struct gpio_regmap *gpio_regmap_register(const
> struct gpio_regmap_config *config
>
> /* if we have a direction register we need both input and output */
> if ((config->reg_dir_out_base || config->reg_dir_in_base) &&
> - (!config->reg_dat_base || !config->reg_set_base))
> + (!config->reg_dat_base && !config->reg_set_base))
> return ERR_PTR(-EINVAL);
>
> /* we don't support having both registers simultaneously for now */
next prev parent reply other threads:[~2021-03-02 21:30 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-02 18:06 [PATCH] gpio: regmap: fix direction register check Álvaro Fernández Rojas
2021-03-02 18:16 ` Michael Walle [this message]
2021-03-02 18:21 ` Álvaro Fernández Rojas
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=c05bf9228206786a09f4f17160a2edf9@walle.cc \
--to=michael@walle.cc \
--cc=andy.shevchenko@gmail.com \
--cc=bgolaszewski@baylibre.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=noltari@gmail.com \
/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).