From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S972957AbdDXQIb (ORCPT ); Mon, 24 Apr 2017 12:08:31 -0400 Received: from mx07-00178001.pphosted.com ([62.209.51.94]:9630 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965377AbdDXQIW (ORCPT ); Mon, 24 Apr 2017 12:08:22 -0400 Subject: Re: [PATCH 3/4] pinctrl: stm32: Implement .get_direction gpio_chip callback To: Linus Walleij References: <1491577811-26989-1-git-send-email-alexandre.torgue@st.com> <1491577811-26989-4-git-send-email-alexandre.torgue@st.com> 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" From: Alexandre Torgue Message-ID: Date: Mon, 24 Apr 2017 18:07:51 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.75.127.44] X-ClientProxiedBy: SFHDAG4NODE2.st.com (10.75.127.11) To SFHDAG3NODE2.st.com (10.75.127.8) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-04-24_12:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Linus, On 04/24/2017 02:37 PM, Linus Walleij wrote: > 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. Ok. I will fix it in V2. Thanks Alex > > Yours, > Linus Walleij >