From mboxrd@z Thu Jan 1 00:00:00 1970 From: Linus Walleij Subject: Re: [PATCH 3/4] pinctrl: stm32: Implement .get_direction gpio_chip callback Date: Mon, 24 Apr 2017 14:37:52 +0200 Message-ID: References: <1491577811-26989-1-git-send-email-alexandre.torgue@st.com> <1491577811-26989-4-git-send-email-alexandre.torgue@st.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: Received: from mail-it0-f54.google.com ([209.85.214.54]:35090 "EHLO mail-it0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1168726AbdDXMhz (ORCPT ); Mon, 24 Apr 2017 08:37:55 -0400 Received: by mail-it0-f54.google.com with SMTP id 70so56027374ita.0 for ; Mon, 24 Apr 2017 05:37:55 -0700 (PDT) In-Reply-To: <1491577811-26989-4-git-send-email-alexandre.torgue@st.com> Sender: linux-gpio-owner@vger.kernel.org List-Id: linux-gpio@vger.kernel.org To: Alexandre TORGUE Cc: Maxime Coquelin , Patrice Chotard , Paul Gortmaker , Rob Herring , "linux-kernel@vger.kernel.org" , "linux-gpio@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "devicetree@vger.kernel.org" On Fri, Apr 7, 2017 at 5:10 PM, Alexandre TORGUE wrote: > Add .get_direction() gpiochip callback in STM32 pinctrl driver. > > Signed-off-by: Alexandre TORGUE (...) > +#include 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1166768AbdDXMiF (ORCPT ); Mon, 24 Apr 2017 08:38:05 -0400 Received: from mail-it0-f50.google.com ([209.85.214.50]:35091 "EHLO mail-it0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1168733AbdDXMhz (ORCPT ); Mon, 24 Apr 2017 08:37:55 -0400 MIME-Version: 1.0 In-Reply-To: <1491577811-26989-4-git-send-email-alexandre.torgue@st.com> References: <1491577811-26989-1-git-send-email-alexandre.torgue@st.com> <1491577811-26989-4-git-send-email-alexandre.torgue@st.com> From: Linus Walleij Date: Mon, 24 Apr 2017 14:37:52 +0200 Message-ID: Subject: Re: [PATCH 3/4] pinctrl: stm32: Implement .get_direction gpio_chip callback To: Alexandre TORGUE Cc: Maxime Coquelin , Patrice Chotard , Paul Gortmaker , Rob Herring , "linux-kernel@vger.kernel.org" , "linux-gpio@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "devicetree@vger.kernel.org" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 7, 2017 at 5:10 PM, Alexandre TORGUE wrote: > Add .get_direction() gpiochip callback in STM32 pinctrl driver. > > Signed-off-by: Alexandre TORGUE (...) > +#include 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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: linus.walleij@linaro.org (Linus Walleij) Date: Mon, 24 Apr 2017 14:37:52 +0200 Subject: [PATCH 3/4] pinctrl: stm32: Implement .get_direction gpio_chip callback In-Reply-To: <1491577811-26989-4-git-send-email-alexandre.torgue@st.com> References: <1491577811-26989-1-git-send-email-alexandre.torgue@st.com> <1491577811-26989-4-git-send-email-alexandre.torgue@st.com> Message-ID: To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Fri, Apr 7, 2017 at 5:10 PM, Alexandre TORGUE wrote: > Add .get_direction() gpiochip callback in STM32 pinctrl driver. > > Signed-off-by: Alexandre TORGUE (...) > +#include 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