From: Alexander Stein <alexander.stein@systec-electronic.com>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Alexandre Courbot <gnurou@gmail.com>,
"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>
Subject: Re: [PATCH 1/1] gpio: pisosr: Don't use magic numbers
Date: Tue, 16 Feb 2016 16:35:42 +0100 [thread overview]
Message-ID: <1799444.UXy1g4WTOV@ws-stein> (raw)
In-Reply-To: <CACRpkda2LXaPFHdqkonNwnRwv_YhTN3AoOsH-wTRoBZ+-J9shg@mail.gmail.com>
On Tuesday 16 February 2016 15:55:47, Linus Walleij wrote:
> On Mon, Feb 15, 2016 at 10:14 AM, Alexander Stein
> <alexander.stein@systec-electronic.com> wrote:
>
> > At first view I thought this function returned an error, but actually
> > it is the input direction. Use the define for input which makes reading
> > the code much easier.
> >
> > Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com>
>
> NACK that flag is for consumers, not drivers.
> Drivers have their own API and should ideally
> return a bool true/false, but that would be another major
> refactoring....
Well, having a callback get_direction returning a bool would seem really strange. Actually the comments on gpiod_get_direction explicitly state GPIOF_DIR_IN and GPIOF_DIR_OUT as return values which aren't used in that function itself, they come from the callback. Also other dirvers like e.g. gpio-ich return (in ichx_gpio_get_direction) GPIOF_DIR_IN or GPIOF_DIR_OUT.
Best regards,
Alexander
--
Dipl.-Inf. Alexander Stein
SYS TEC electronic GmbH
alexander.stein@systec-electronic.com
Legal and Commercial Address:
Am Windrad 2
08468 Heinsdorfergrund
Germany
Office: +49 (0) 3765 38600-0
Fax: +49 (0) 3765 38600-4100
Managing Directors:
Director Technology/CEO: Dipl.-Phys. Siegmar Schmidt;
Director Commercial Affairs/COO: Dipl. Ing. (FH) Armin von Collrepp
Commercial Registry:
Amtsgericht Chemnitz, HRB 28082; USt.-Id Nr. DE150534010
next prev parent reply other threads:[~2016-02-16 15:35 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-15 9:14 [PATCH 1/1] gpio: pisosr: Don't use magic numbers Alexander Stein
2016-02-16 14:55 ` Linus Walleij
2016-02-16 15:35 ` Alexander Stein [this message]
2016-02-16 16:00 ` 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=1799444.UXy1g4WTOV@ws-stein \
--to=alexander.stein@systec-electronic.com \
--cc=gnurou@gmail.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@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).