[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACRpkdZG-yxMCzBqP2s37QThP7tgWKgd3pVgZGgceB+ihZs3nw@mail.gmail.com>
Date: Mon, 24 Apr 2017 14:37:52 +0200
From: Linus Walleij <linus.walleij@...aro.org>
To: Alexandre TORGUE <alexandre.torgue@...com>
Cc: Maxime Coquelin <mcoquelin.stm32@...il.com>,
Patrice Chotard <patrice.chotard@...com>,
Paul Gortmaker <paul.gortmaker@...driver.com>,
Rob Herring <robh+dt@...nel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-gpio@...r.kernel.org" <linux-gpio@...r.kernel.org>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>,
"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>
Subject: Re: [PATCH 3/4] pinctrl: stm32: Implement .get_direction gpio_chip callback
On Fri, Apr 7, 2017 at 5:10 PM, Alexandre TORGUE
<alexandre.torgue@...com> wrote:
> Add .get_direction() gpiochip callback in STM32 pinctrl driver.
>
> Signed-off-by: Alexandre TORGUE <alexandre.torgue@...com>
(...)
> +#include <linux/gpio.h>
No this is wrong, drivers should never include this file.
It is a deprecated consumer header.
> + if ((alt == 0) && (mode == 0))
> + ret = GPIOF_DIR_IN;
> + else if ((alt == 0) && (mode == 1))
> + ret = GPIOF_DIR_OUT;
Just return 0 or 1, that is the driver-internal API.
Yours,
Linus Walleij
Powered by blists - more mailing lists