From: Linus Walleij <linus.walleij@linaro.org>
To: Laxman Dewangan <ldewangan@nvidia.com>
Cc: Alexandre Courbot <gnurou@gmail.com>,
"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/3] gpio: max77620: Implement gpio_get_direction callback
Date: Mon, 30 May 2016 17:03:35 +0200 [thread overview]
Message-ID: <CACRpkdbM=Ew6sPzGYFSst8p8AtaLAeDTxOaXUMBS8Qj2=HcuRA@mail.gmail.com> (raw)
In-Reply-To: <1464095626-28424-2-git-send-email-ldewangan@nvidia.com>
On Tue, May 24, 2016 at 3:13 PM, Laxman Dewangan <ldewangan@nvidia.com> wrote:
> Implement gpio_get_direction() callback for MAX77620 GPIO.
> This is useful for debugfs and the userspace ABI.
>
> Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
> #include <linux/gpio/driver.h>
> +#include <linux/gpio.h>
No. This is a sign that something is wrong, no driver should include
this unless it is using GPIOs as a resource itself.
> + return (val & MAX77620_CNFG_GPIO_DIR_MASK) ?
> + GPIOF_DIR_IN : GPIOF_DIR_OUT;
Just return 0 or 1. The driver-internal API isn't smarter than that.
Yours,
Linus Walleij
next prev parent reply other threads:[~2016-05-30 15:03 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-24 13:13 [PATCH 1/3] gpio: max77620: Configure interrupt trigger level Laxman Dewangan
2016-05-24 13:13 ` [PATCH 2/3] gpio: max77620: Implement gpio_get_direction callback Laxman Dewangan
2016-05-30 15:03 ` Linus Walleij [this message]
2016-05-31 5:53 ` Laxman Dewangan
2016-05-24 13:13 ` [PATCH 3/3] gpio: max77620: use the new open drain callback Laxman Dewangan
2016-05-30 15:05 ` Linus Walleij
2016-05-30 15:01 ` [PATCH 1/3] gpio: max77620: Configure interrupt trigger level Linus Walleij
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='CACRpkdbM=Ew6sPzGYFSst8p8AtaLAeDTxOaXUMBS8Qj2=HcuRA@mail.gmail.com' \
--to=linus.walleij@linaro.org \
--cc=gnurou@gmail.com \
--cc=ldewangan@nvidia.com \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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).