From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 46537C05027 for ; Thu, 26 Jan 2023 13:46:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230035AbjAZNqd (ORCPT ); Thu, 26 Jan 2023 08:46:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33148 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230352AbjAZNqb (ORCPT ); Thu, 26 Jan 2023 08:46:31 -0500 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F0FD53C2C; Thu, 26 Jan 2023 05:46:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1674740789; x=1706276789; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=vrS30aIV2IHHyAksZ/6zJl0RtGur8hynqjqn0BJeecU=; b=I867bbOPTP6+tc71LUYe1Sz7xkb1l8pFHrW56tx9J23Cowx9gKi46EdQ eW2r4hQKpwXiSGOduUHWFk7whkWbcLfwgecVvcC1Qgzq5Jb4VrL5nX/nI Hd8MsWHUvM9YVuDxOyIw54DqAQ/gvf/dHjfxAbxxIrFj51xAeI0qyO9ka uYIWN2/2dNE/pY75L6N13pP7sHBsWCD/4mPmigj7iEnwCwudPk0l2frOy fYrAUaJMLt2ilRd2+uZ6KtmdiMJQg68RliRRg8l1XDxpq91+LP+4dYJ83 MH2xb1hXoqZ4Bkxr5g2Ni4zsRE76nPoZqnvpamleNUu5IDYtKIoY5b7PL g==; X-IronPort-AV: E=McAfee;i="6500,9779,10602"; a="307159279" X-IronPort-AV: E=Sophos;i="5.97,248,1669104000"; d="scan'208";a="307159279" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jan 2023 05:46:28 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10602"; a="693337328" X-IronPort-AV: E=Sophos;i="5.97,248,1669104000"; d="scan'208";a="693337328" Received: from smile.fi.intel.com ([10.237.72.54]) by orsmga008.jf.intel.com with ESMTP; 26 Jan 2023 05:46:25 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1pL2a8-00FQB8-0A; Thu, 26 Jan 2023 15:46:24 +0200 Date: Thu, 26 Jan 2023 15:46:23 +0200 From: Andy Shevchenko To: Arnd Bergmann Cc: linux-gpio@vger.kernel.org, Arnd Bergmann , Bartosz Golaszewski , Christophe Leroy , Dmitry Torokhov , Linus Walleij , linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/8] gpiolib: remove asm-generic/gpio.h Message-ID: References: <20230126132801.2042371-1-arnd@kernel.org> <20230126132801.2042371-4-arnd@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230126132801.2042371-4-arnd@kernel.org> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org On Thu, Jan 26, 2023 at 02:27:56PM +0100, Arnd Bergmann wrote: > From: Arnd Bergmann > > The asm-generic/gpio.h file is now always included when > using gpiolib, so just move its contents into linux/gpio.h > with a few minor simplifications. Thanks! Very appreciated, my comments below. ... > --- a/drivers/gpio/gpio-davinci.c > +++ b/drivers/gpio/gpio-davinci.c > @@ -7,6 +7,7 @@ > */ > #include > +#include I believe the driver does not need this. I have briefly checked all gpio_ places in it and found nothing that requires this inclusion to be done. > #include > #include > #include > @@ -24,8 +25,6 @@ > #include > #include > > -#include > - > #define MAX_REGS_BANKS 5 > #define MAX_INT_PER_BANK 32 Thanks for this, that was a PITA! ... > --- a/drivers/pinctrl/core.c > +++ b/drivers/pinctrl/core.c > @@ -30,7 +30,7 @@ > > #ifdef CONFIG_GPIOLIB > #include "../gpio/gpiolib.h" > -#include > +#include Can we actually swap them? #include #include "../gpio/gpiolib.h" But hold on, why do we even need gpio.h here?! > #endif > > #include "core.h" ... > --- a/include/linux/gpio.h > +++ b/include/linux/gpio.h > @@ -54,26 +54,101 @@ struct gpio { > }; > > #ifdef CONFIG_GPIOLIB > -#include > +#include > +#include > +#include #include #include ... > +/* > + * "valid" GPIO numbers are nonnegative and may be passed to > + * setup routines like gpio_request(). only some valid numbers While at it, '. only' --> '. Only'. > + * can successfully be requested and used. > + * > + * Invalid GPIO numbers are useful for indicating no-such-GPIO in > + * platform data and other tables. > + */ ... > +extern int gpio_request(unsigned gpio, const char *label); > +extern void gpio_free(unsigned gpio); While at it, s/extern//. ... > +extern int gpio_request_one(unsigned gpio, unsigned long flags, const char *label); > +extern int gpio_request_array(const struct gpio *array, size_t num); > +extern void gpio_free_array(const struct gpio *array, size_t num); Ditto. -- With Best Regards, Andy Shevchenko