From: Laxman Dewangan <ldewangan@nvidia.com>
To: Linus Walleij <linus.walleij@linaro.org>
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: Tue, 31 May 2016 11:23:06 +0530 [thread overview]
Message-ID: <574D26C2.1090502@nvidia.com> (raw)
In-Reply-To: <CACRpkdbM=Ew6sPzGYFSst8p8AtaLAeDTxOaXUMBS8Qj2=HcuRA@mail.gmail.com>
On Monday 30 May 2016 08:33 PM, Linus Walleij wrote:
> 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.
This is just to use the flag GPIOF_*
As you said below, we can use the 0 and 1, there is no need to include
header.
Will post the v2 patch for this.
>> + 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.
>
Thanks,
Laxman
next prev parent reply other threads:[~2016-05-31 6:05 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
2016-05-31 5:53 ` Laxman Dewangan [this message]
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=574D26C2.1090502@nvidia.com \
--to=ldewangan@nvidia.com \
--cc=gnurou@gmail.com \
--cc=linus.walleij@linaro.org \
--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).