Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1629489 > unrolled thread

Re: [PATCH 3/4] pinctrl: stm32: Implement .get_direction gpio_chip callback

Started byLinus Walleij <linus.walleij@linaro.org>
First post2017-04-24 14:40 +0200
Last post2017-04-24 18:10 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH 3/4] pinctrl: stm32: Implement .get_direction gpio_chip callback Linus Walleij <linus.walleij@linaro.org> - 2017-04-24 14:40 +0200
    Re: [PATCH 3/4] pinctrl: stm32: Implement .get_direction gpio_chip  callback Alexandre Torgue <alexandre.torgue@st.com> - 2017-04-24 18:10 +0200

#1629489 — Re: [PATCH 3/4] pinctrl: stm32: Implement .get_direction gpio_chip callback

FromLinus Walleij <linus.walleij@linaro.org>
Date2017-04-24 14:40 +0200
SubjectRe: [PATCH 3/4] pinctrl: stm32: Implement .get_direction gpio_chip callback
Message-ID<tzLrB-6Zn-23@gated-at.bofh.it>
On Fri, Apr 7, 2017 at 5:10 PM, Alexandre TORGUE
<alexandre.torgue@st.com> wrote:

> Add .get_direction() gpiochip callback in STM32 pinctrl driver.
>
> Signed-off-by: Alexandre TORGUE <alexandre.torgue@st.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

[toc] | [next] | [standalone]


#1629721 — Re: [PATCH 3/4] pinctrl: stm32: Implement .get_direction gpio_chip callback

FromAlexandre Torgue <alexandre.torgue@st.com>
Date2017-04-24 18:10 +0200
SubjectRe: [PATCH 3/4] pinctrl: stm32: Implement .get_direction gpio_chip callback
Message-ID<tzOIO-JE-11@gated-at.bofh.it>
In reply to#1629489
Hi Linus,

On 04/24/2017 02:37 PM, Linus Walleij wrote:
> On Fri, Apr 7, 2017 at 5:10 PM, Alexandre TORGUE
> <alexandre.torgue@st.com> wrote:
>
>> Add .get_direction() gpiochip callback in STM32 pinctrl driver.
>>
>> Signed-off-by: Alexandre TORGUE <alexandre.torgue@st.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.

Ok. I will fix it in V2.

Thanks
Alex

>
> Yours,
> Linus Walleij
>

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web