From patchwork Wed Jan 25 20:10:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 48303 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp464712wrn; Wed, 25 Jan 2023 12:12:02 -0800 (PST) X-Google-Smtp-Source: AMrXdXtLvJjsvzpBlDwFqK2gKgMaZLvQXJr4IQqz1v6Iusd1kTVLWqmtKzTmdjYqhMe7+x7E+hJw X-Received: by 2002:a17:907:80cf:b0:7c1:962e:cf24 with SMTP id io15-20020a17090780cf00b007c1962ecf24mr37700751ejc.50.1674677522803; Wed, 25 Jan 2023 12:12:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674677522; cv=none; d=google.com; s=arc-20160816; b=IFYXlzqeyeETealSSI9ggOFa7ottnYEBvPamn4kqXpXK7E76H/zmF8i0D9vQnVITgT 3rsN4PsR2ECtAan+4YoG3u+Q49LNpgMT3zx5qcBpC2mDj4mBlLfM2ZUUjUOEWHoKA5YK SEHdYmm/8IR41mVJSGC/Vv8pamerRjRjFUze7c1VoPed+6YxoGPtRU6QHNtF5M2Zclqo pWlMoVctWov3BuRb8qvwB0hEfa8nZS9FyxqWK1/Gf0XImuRuMdChdJG8urZtjAnWzm6H +O6EwrBTp/Twyui9quQm3X4InNpCqpsi8l31PG4IoX5bR7bDMPcmXsO7fP+1Fp1bw3OL ZkHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=uUf2sV3BkGC+X3F0jQzcaytoPNQ/yUkIdTHWDQrNsvw=; b=cEzGkWavYgVSvyVzxd4cbZ/MI9s2o2xrPich9RG7yd7qeimfYg36LrT0qc/aJ8HQnE vY98hLatoGsoThTASr+TBKPT1BUnOApRJ3mLuklEhPgiKyMtVstmjxLGfZWMRN2FCc0V bdtbI8mgz5Aks8qdfggMEJfl3TAJO1tuaAxWvy3NEvktLUHg4QP2uaV5zpmzqyFW5weP 5muv9Y3G1Jf23M1AHHwlUL1y52FOCanU/hO9AMb+RwyQH4a2ZQI3aVPhFyWAx4Gfbc79 UE799vN7mjw3xNfbVNhDZ3sLaUIs24R5Cy0G7miCN1b99rQy9dkWXc/2N8r3jzaJjRHx g9Pg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=W2j+5NCu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x16-20020a05640226d000b004a056941677si9789147edd.471.2023.01.25.12.11.39; Wed, 25 Jan 2023 12:12:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=W2j+5NCu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236304AbjAYUKv (ORCPT + 99 others); Wed, 25 Jan 2023 15:10:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45218 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236338AbjAYUKs (ORCPT ); Wed, 25 Jan 2023 15:10:48 -0500 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A3EC45D11A; Wed, 25 Jan 2023 12:10:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1674677418; x=1706213418; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=mWptUuAvNZS0kbLHRKn6oORyrZ25KQvA1dzBPjHWj5Y=; b=W2j+5NCuuX9pBpvjyjnweD+WaROJFjF8T0ZucJZB2nuFzVfah4nYli2y FPmk1UyN5rMTibZfXz7K+D0gWnLpf26Yo7fa/GwuYjU+KsnrmyDXsW0GW JyHz8mPoX3IR9+ZKGXEMo4aGxYYRXgcaVD9dHcYpfwaMulEfQdLSGPbrQ uVdqXRkC33Vo59KxgO0yEOOh+3iDItsHD79IPj1MuA5Ga5kSEu6cbfuss sOL7wYnOek1Q0ZbY4Du8LnDMN/j99/ARG3138/bvpsrHsT456z3yXPRHB NbD3Rjk94XR9hPO4yYSIjjeFtdpctugJt3N3E8RXu0z8BJBu9Ix11rVu2 A==; X-IronPort-AV: E=McAfee;i="6500,9779,10601"; a="326694750" X-IronPort-AV: E=Sophos;i="5.97,246,1669104000"; d="scan'208";a="326694750" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jan 2023 12:09:52 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10601"; a="770871658" X-IronPort-AV: E=Sophos;i="5.97,246,1669104000"; d="scan'208";a="770871658" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga002.fm.intel.com with ESMTP; 25 Jan 2023 12:09:49 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 3ABE992; Wed, 25 Jan 2023 22:10:25 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , Bartosz Golaszewski , Christophe Leroy , Dmitry Torokhov , linux-gpio@vger.kernel.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Linus Walleij , Bartosz Golaszewski , Arnd Bergmann , Pierluigi Passaro , kernel test robot Subject: [PATCH v1 1/5] gpiolib: fix linker errors when GPIOLIB is disabled Date: Wed, 25 Jan 2023 22:10:16 +0200 Message-Id: <20230125201020.10948-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230125201020.10948-1-andriy.shevchenko@linux.intel.com> References: <20230125201020.10948-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756026657907074843?= X-GMAIL-MSGID: =?utf-8?q?1756026657907074843?= From: Pierluigi Passaro Both the functions gpiochip_request_own_desc and gpiochip_free_own_desc are exported from drivers/gpio/gpiolib.c but this file is compiled only when CONFIG_GPIOLIB is enabled. Move the prototypes under "#ifdef CONFIG_GPIOLIB" and provide reasonable definitions and includes in the "#else" branch. Fixes: 9091373ab7ea ("gpio: remove less important #ifdef around declarations") Signed-off-by: Pierluigi Passaro Reported-by: kernel test robot Signed-off-by: Andy Shevchenko --- include/linux/gpio/driver.h | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h index 26a808fb8a25..67990908a040 100644 --- a/include/linux/gpio/driver.h +++ b/include/linux/gpio/driver.h @@ -751,6 +751,8 @@ gpiochip_remove_pin_ranges(struct gpio_chip *gc) #endif /* CONFIG_PINCTRL */ +#ifdef CONFIG_GPIOLIB + struct gpio_desc *gpiochip_request_own_desc(struct gpio_chip *gc, unsigned int hwnum, const char *label, @@ -758,8 +760,6 @@ struct gpio_desc *gpiochip_request_own_desc(struct gpio_chip *gc, enum gpiod_flags dflags); void gpiochip_free_own_desc(struct gpio_desc *desc); -#ifdef CONFIG_GPIOLIB - /* lock/unlock as IRQ */ int gpiochip_lock_as_irq(struct gpio_chip *gc, unsigned int offset); void gpiochip_unlock_as_irq(struct gpio_chip *gc, unsigned int offset); @@ -769,6 +769,25 @@ struct gpio_chip *gpiod_to_chip(const struct gpio_desc *desc); #else /* CONFIG_GPIOLIB */ +#include +#include + +static inline struct gpio_desc *gpiochip_request_own_desc(struct gpio_chip *gc, + unsigned int hwnum, + const char *label, + enum gpio_lookup_flags lflags, + enum gpiod_flags dflags) +{ + /* GPIO can never have been requested */ + WARN_ON(1); + return ERR_PTR(-ENODEV); +} + +static inline void gpiochip_free_own_desc(struct gpio_desc *desc) +{ + WARN_ON(1); +} + static inline struct gpio_chip *gpiod_to_chip(const struct gpio_desc *desc) { /* GPIO can never have been requested */ From patchwork Wed Jan 25 20:10:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 48304 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp464820wrn; Wed, 25 Jan 2023 12:12:16 -0800 (PST) X-Google-Smtp-Source: AMrXdXvTEICKnfhdrwMDx63IOqKcy7Tg4KwfW7XzEF2wh+trUN5hCUvKvHVxgLslUBhAtoxFL3f/ X-Received: by 2002:a05:6402:4305:b0:49b:4711:f4b4 with SMTP id m5-20020a056402430500b0049b4711f4b4mr42295315edc.0.1674677536080; Wed, 25 Jan 2023 12:12:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674677536; cv=none; d=google.com; s=arc-20160816; b=lu8aPy3TCM5/2TKTjIWCgw/clcUb0TUWIRr8fDJIds83gqUgNJ5pIJwA42FTJijUoV b5OtIpqa0C+oY7hXRa0gkzFt/oGfFuxHcN91FI/IPYrUD1DIcEPLUYc8sHwi+OiU23dC 4fOujVJETvWLk/MwLc7UolQngtBf8EZQx/UtecqgkldvgIASKZLhSOjvq7CimD4cFfjs 6LGpG40gRQrikdr9d9gG7EP1rgSpd4oU/B+43imtck2yb8aa/pnMj3NmT/jvESKhI1/v nxJ6fPn58emSwugyi04RIudK3V3d5aYZu152ceHtNRJ8WSwYxjnkMOZfhywS3+2HlqX5 RLKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=9ZMUzGoKdLm5md08l4bEG1G0/6n840ZXzz3fqSmjTQk=; b=cBtxqtBihsUruKMuSvFIpE8cA3Q9/0be6eJNcWvpfKmDxeAUf9TakLb5Si1ugv5Bto i55ixwHlxAd6jBHtqKepy7Y5cRxdmPyKWFHCa7ofz36DgmOhfm/sqMvrXGHBos7pHhjx SCrxAbSJEwjfkU19L31GVCBFfeVHFIUDNk6hq/ErCMaPrXDD3R3nXtWxupewn20Ig2Hq i5bMQxL2RUKdMKZ8TbbpZFeVsBkmcNVCmTy9UqG4/I5kwyFDsktfsIY4gWv7sGtWmQ0p fLrXJyNXQ+MhX4GpUgsecnDfCSkZosMBN/8RGMSFizPlQViWBjnvSBJ7qRdlPIfFNine RVEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="m/nQUBVF"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i3-20020aa7c703000000b0048ef339fc7fsi7220587edq.574.2023.01.25.12.11.52; Wed, 25 Jan 2023 12:12:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="m/nQUBVF"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235895AbjAYULO (ORCPT + 99 others); Wed, 25 Jan 2023 15:11:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45668 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236363AbjAYULG (ORCPT ); Wed, 25 Jan 2023 15:11:06 -0500 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 20C485CFD4; Wed, 25 Jan 2023 12:10:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1674677434; x=1706213434; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=5Hlz2xZdhX7D5SV1buuKCO4EsYWA++GKMkQIjgY/afA=; b=m/nQUBVFl3vPkJCLZwJb0n4SA9ZngLvxdawu0tZRBAmSE2nXj/nRgQGG pyA4Rm400JOZ/Q+rZ98wBT1QWPqinjT5ddgErRfqMe7R7U5I9BxGPMpPr ScaYQJ4paGm5PIIg6jS7oXpPChSyReGMI7ZPrrexvLITCvMk37Ae24WPq l4nMcGYWLmqLnRZWgIimthmHRah5MS7RFmTfe4vrx8CviPhdvZVFoxXXh BzKRsnfhXfNVqWh5JCfdqH8go2ZvPCNmRzf7CM6vc0kq++5NnBuc/0YjH Fws9uaTYH2z9zTZaiWjWE0kf8mUk2Z5qm8AGjbUVdMzrDTXRsrXEH997H g==; X-IronPort-AV: E=McAfee;i="6500,9779,10601"; a="326694762" X-IronPort-AV: E=Sophos;i="5.97,246,1669104000"; d="scan'208";a="326694762" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jan 2023 12:09:52 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10601"; a="770871611" X-IronPort-AV: E=Sophos;i="5.97,246,1669104000"; d="scan'208";a="770871611" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga002.fm.intel.com with ESMTP; 25 Jan 2023 12:09:49 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 43C1319C; Wed, 25 Jan 2023 22:10:25 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , Bartosz Golaszewski , Christophe Leroy , Dmitry Torokhov , linux-gpio@vger.kernel.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Linus Walleij , Bartosz Golaszewski , Arnd Bergmann Subject: [PATCH v1 2/5] gpio: Drop unused forward declaration from driver.h Date: Wed, 25 Jan 2023 22:10:17 +0200 Message-Id: <20230125201020.10948-3-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230125201020.10948-1-andriy.shevchenko@linux.intel.com> References: <20230125201020.10948-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756026671907242237?= X-GMAIL-MSGID: =?utf-8?q?1756026671907242237?= There is no struct device_node pointers anywhere in the header, drop unused forward declaration. Signed-off-by: Andy Shevchenko --- include/linux/gpio/driver.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h index 67990908a040..caf2376dd98b 100644 --- a/include/linux/gpio/driver.h +++ b/include/linux/gpio/driver.h @@ -16,7 +16,6 @@ struct gpio_desc; struct of_phandle_args; -struct device_node; struct seq_file; struct gpio_device; struct module; From patchwork Wed Jan 25 20:10:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 48307 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp469507wrn; Wed, 25 Jan 2023 12:24:11 -0800 (PST) X-Google-Smtp-Source: AMrXdXsfjYGckuDznDQqkRckOIGNsvQFQJhJvhj7mWdmxosz+cMfkPc/LjHOjpavZy9bK5VDbl/4 X-Received: by 2002:a17:906:b305:b0:86e:8b7b:adb9 with SMTP id n5-20020a170906b30500b0086e8b7badb9mr31330060ejz.34.1674678251649; Wed, 25 Jan 2023 12:24:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674678251; cv=none; d=google.com; s=arc-20160816; b=YZDHj73zdkdsJ8jh8aJvq/Tl8PTjz1qxG6LU0TKu/rlwBW4+YaQhjEwlV/CpglwZ0P p76mp0uk80mW4hiE7V+3PIoMGaLsHD0EmeW28N1ZMrHouDRMpIt/XW9PNEhF/RYUrZE3 rMPg0EwdQq9VSoS3+4lc0BvhWqmG/1SozByfoORc8FrP4xWPTaglXSgVouUX0OM4zhmS vDwFNmDTPRwosAcYjtolEBCdjNcPGdswymKz3WdReS8J/ic3zFtbtwy3ly7SNgX/c0JT pvxGPzGvVR90scRxPvBZa6cRzIx0a80wbwj4evFO2eHrgAZTA5GQ/pFGXlkUx95kk+2p OAnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Mp7hmOanmpUMVchSSpxqhzq+pPqSBvla9THd4AHf5gM=; b=Qv2HDrNVzVaIPb4oqned8uVslg6QShCHb5eD5wL/gYsXSESjlaBFQZbJx3oz1bqTq9 K8VjC1t3uPI3BKpyY77cJBTdd+F69On1NQsQOSbZSpM98MqB4NmG8R6aEEYsuez1skaC 0w9Jx6SZ/FRkzafB5RoX/eX9FC3d+Vxq+0ZkM/s5efa4G7EKj0lUR7omysT0FELPwhBs 7FstiHNvJ7zQMzWLnUX750F8kzCju//70qpLpFn6xfF+xT47D58s4+GGUyEetGnDXX+G Gfsjo3sB7IKrlzZ/IbBx8t2ogQb7AhXkBICJQbHAE5BRZmJiZ+J8QtR6scmcNf43c/ex tyTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=dbep2eBv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 23-20020a17090601d700b00877db5bfb5csi9200525ejj.694.2023.01.25.12.23.43; Wed, 25 Jan 2023 12:24:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=dbep2eBv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236364AbjAYULv (ORCPT + 99 others); Wed, 25 Jan 2023 15:11:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45876 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236317AbjAYULo (ORCPT ); Wed, 25 Jan 2023 15:11:44 -0500 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D452C5CFEB; Wed, 25 Jan 2023 12:11:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1674677474; x=1706213474; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=TmiJH7yegRFkVHybG0Js6InCkhSr5S2J1lLVxKNHjiI=; b=dbep2eBvwm7ZqcXWwPw19rxb0/7bTwj5J4heOWNaccelawDkaoDdkxY+ rxLLF1M+1juO/eH/MgO2BAPT4RuxbvLuJIs/gRDAsM6sNvVhOAuBKLcIE oyOd3SKynaSArw2jZ9sSAibHDNWojvfF8Y0dY5Low6wMm53KR/+NwcNYg n+zHucbxgYmCWxQ4G9IOEM4Tn8DkM+izV6szXD/yVdJeiAJjTT56LCdTc lhVnZ+uSIo6SJ5WpTiQzyfT37RJLmn5MmtLx+m/Orz41/144/KyGKIdA3 eRpnO5u/Skeo4Dcst3cO9X2SaEDXMona3G2OKfFIKqJ32ijRNP+Q6KRUz g==; X-IronPort-AV: E=McAfee;i="6500,9779,10601"; a="326694781" X-IronPort-AV: E=Sophos;i="5.97,246,1669104000"; d="scan'208";a="326694781" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jan 2023 12:09:53 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10601"; a="770871613" X-IronPort-AV: E=Sophos;i="5.97,246,1669104000"; d="scan'208";a="770871613" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga002.fm.intel.com with ESMTP; 25 Jan 2023 12:09:49 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 4A87A1F0; Wed, 25 Jan 2023 22:10:25 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , Bartosz Golaszewski , Christophe Leroy , Dmitry Torokhov , linux-gpio@vger.kernel.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Linus Walleij , Bartosz Golaszewski , Arnd Bergmann Subject: [PATCH v1 3/5] gpio: Deduplicate forward declarations in consumer.h Date: Wed, 25 Jan 2023 22:10:18 +0200 Message-Id: <20230125201020.10948-4-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230125201020.10948-1-andriy.shevchenko@linux.intel.com> References: <20230125201020.10948-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756027422631522893?= X-GMAIL-MSGID: =?utf-8?q?1756027422631522893?= The struct fwnode_handle pointer is used in both branches of ifdeffery, no need to have a copy of the same in each of them, just make it global. Signed-off-by: Andy Shevchenko --- include/linux/gpio/consumer.h | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/include/linux/gpio/consumer.h b/include/linux/gpio/consumer.h index 59cb20cfac3d..a7eb8aa1e54c 100644 --- a/include/linux/gpio/consumer.h +++ b/include/linux/gpio/consumer.h @@ -8,6 +8,7 @@ #include struct device; +struct fwnode_handle; struct gpio_desc; struct gpio_array; @@ -171,9 +172,6 @@ int gpiod_set_consumer_name(struct gpio_desc *desc, const char *name); struct gpio_desc *gpio_to_desc(unsigned gpio); int desc_to_gpio(const struct gpio_desc *desc); -/* Child properties interface */ -struct fwnode_handle; - struct gpio_desc *fwnode_gpiod_get_index(struct fwnode_handle *fwnode, const char *con_id, int index, enum gpiod_flags flags, @@ -546,9 +544,6 @@ static inline int desc_to_gpio(const struct gpio_desc *desc) return -EINVAL; } -/* Child properties interface */ -struct fwnode_handle; - static inline struct gpio_desc *fwnode_gpiod_get_index(struct fwnode_handle *fwnode, const char *con_id, int index, From patchwork Wed Jan 25 20:10:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 48305 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp464841wrn; Wed, 25 Jan 2023 12:12:19 -0800 (PST) X-Google-Smtp-Source: AMrXdXsJdJC3kAsTJS/jYWQ4DPsmmANzqpwMEVHIOyQ8de8lNdA/bF/E/NnrWRDBYlibyRKz5uJT X-Received: by 2002:a17:906:a40b:b0:846:95f9:5b4d with SMTP id l11-20020a170906a40b00b0084695f95b4dmr34901167ejz.42.1674677539621; Wed, 25 Jan 2023 12:12:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674677539; cv=none; d=google.com; s=arc-20160816; b=vOemZtidtqSyS7IKBdHZd9Y2oUUF1RdFbLJGcv6BghVTkm6XtJVGq/N7x2qHKbnchY cjRFfYTXJqrrcFAFVgF4M2pT6aCwBtlInnMq1lU+BtiOmxq/1+BQVYwBKt26YVXvWdo0 RkY/dzs99wiio5qbPzSiMjit4XYR9m6QZTnxaCfPMKyG8zHOABsu1Tov5E3egMeiyOKG Fdvyrcm2QrsnwneeUdysnsKBcRlYJgc412l8i7CZpHsOOn1o/6afPBPErYeN3Ego/Fqp Iepaa5Y788V5GU4slMpd/nsleqIdRIVrH9h6POHU/kptn1UyVkj8r4cRMJVbqQncQ2F/ QRPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=It5J1UOWBJJXEk6i7YGAGl8CGg9z02BCnnZujw4jMss=; b=Ux70Xy9c0a35H0vnD4U+W1yxgLC5wYOh7T+Ajvy1DFXjHtYnr1Wgvfitoy0XmsY3Q7 46fcpHt2pNTYjDrPNZ5Ug1c4b76hOfbJ+v4pgLoA721lMF+jMcrzYinQOVcDqBQ1cB6H HMaFf4gJHQ7sWtK1RoNs9XA36z7kA9xMVGiyagmYzfkCzRTOfk0sJ9xck5NtewYKcvEa aqzPoRh1KgMwkbnLk4gYFVUarO2Q2zlEROEIFkDeyxKDFBQAeCHtuYMioz57bEO5iYge AcD2xlAyLkUY2BnxYWPamn2TtceeRo1+lpCBhRxqzF0ebC6mlNOOo7bYn+q29AyjWdox q1zw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=bZk7cp6B; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id fq21-20020a1709069d9500b00870b608e433si7316243ejc.36.2023.01.25.12.11.56; Wed, 25 Jan 2023 12:12:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=bZk7cp6B; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236356AbjAYULY (ORCPT + 99 others); Wed, 25 Jan 2023 15:11:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45930 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236366AbjAYULO (ORCPT ); Wed, 25 Jan 2023 15:11:14 -0500 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2C6DC5D11D; Wed, 25 Jan 2023 12:10:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1674677448; x=1706213448; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=G7N++5tY9N8FPCWRBFWAEI9Nl1zncmIAaWLLx8WidN8=; b=bZk7cp6BJrxyuAynxkHk5oL4e7SzLminQa3Mg516fTKg/KhHPDi5SjCp LEnZer9ho1hK9kp6lNB8jwfRCHUd60AlexranCxyj4KQz4zit2rW2UA+k gArlcLRkEyl3tKEj/cKwMtWvahdw1lUE2ItFrHK5ouqJm+A3POv6RI4Kf l5gD65A4YZxqSJGpYM14dhRK9/zfyPuHqXQL14abZcbDqxY/b5/M0b35M X90uv6gWUk4oPBwaX5msND8ft1ItRRmsIPD/WDwXMPaTQGu5C7hxGWHEc AJp52rtuiKdOys4ySXfo41+jPU0Jn6EbTmBUidDxGSMXoPwnZBYKvVRrq g==; X-IronPort-AV: E=McAfee;i="6500,9779,10601"; a="326694769" X-IronPort-AV: E=Sophos;i="5.97,246,1669104000"; d="scan'208";a="326694769" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jan 2023 12:09:52 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10601"; a="770871612" X-IronPort-AV: E=Sophos;i="5.97,246,1669104000"; d="scan'208";a="770871612" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga002.fm.intel.com with ESMTP; 25 Jan 2023 12:09:49 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 51273357; Wed, 25 Jan 2023 22:10:25 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , Bartosz Golaszewski , Christophe Leroy , Dmitry Torokhov , linux-gpio@vger.kernel.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Linus Walleij , Bartosz Golaszewski , Arnd Bergmann Subject: [PATCH v1 4/5] gpio: Group forward declarations in consumer.h Date: Wed, 25 Jan 2023 22:10:19 +0200 Message-Id: <20230125201020.10948-5-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230125201020.10948-1-andriy.shevchenko@linux.intel.com> References: <20230125201020.10948-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756026675686285218?= X-GMAIL-MSGID: =?utf-8?q?1756026675686285218?= For better maintenance group the forward declarations together. Signed-off-by: Andy Shevchenko --- include/linux/gpio/consumer.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/include/linux/gpio/consumer.h b/include/linux/gpio/consumer.h index a7eb8aa1e54c..5432e5d5fbfb 100644 --- a/include/linux/gpio/consumer.h +++ b/include/linux/gpio/consumer.h @@ -7,6 +7,7 @@ #include #include +struct acpi_device; struct device; struct fwnode_handle; struct gpio_desc; @@ -602,8 +603,6 @@ struct acpi_gpio_mapping { unsigned int quirks; }; -struct acpi_device; - #if IS_ENABLED(CONFIG_GPIOLIB) && IS_ENABLED(CONFIG_ACPI) int acpi_dev_add_driver_gpios(struct acpi_device *adev, From patchwork Wed Jan 25 20:10:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 48308 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp472630wrn; Wed, 25 Jan 2023 12:32:25 -0800 (PST) X-Google-Smtp-Source: AMrXdXsJyGBvguUhdlsGonsroCfeBa6SQshfT/3JDemF7KhOEMzB5M1Y4JU5Ews9/IlUTHqznwvB X-Received: by 2002:a17:90a:199:b0:22b:b794:bb43 with SMTP id 25-20020a17090a019900b0022bb794bb43mr20608802pjc.38.1674678745583; Wed, 25 Jan 2023 12:32:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674678745; cv=none; d=google.com; s=arc-20160816; b=0uWtxnEHiDEKLmiQbcXC8XNfcJEcf40T+dPnFfonboix9F5E0lepN8a8D2PKtLxfGO otfPYDM+t2I3SMCmf1R9IVtI4b6qeGCuMU34v11uW1eK3D0WsWrDPDeBV9tEtvFZOCMh wIfAYS0ENp10qU6k1OCUqJ8GJlbWwyODORn4WN12VNmhqdY8zzmBnSdjWzWzp/lZ/nX6 QW1p6IG+F6OJ/5inH5pCc6KHm5JxXBWTbQu4+LNVOZSpo5NyTQCn9PqKsAvGLy4SPedE PIjFTR8DMJRyNFYNbg6GpwSUDdBM2G7WDhvHpV58ph2bYQ8B8NDr5WxWxulepuKRwDeP vspQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ZYgc6RwvcpnihvTmkIyK0mMHhhnD6/qByl7dyE+zDvM=; b=RQNZJkhkBsZEk0KzQOZtQXi5X6cg8raQnPFuH7FRAVFHtVZpcIs9WUUz3yRCqd0klU kZWUO5RzZskbcHhEkHUZ69U8ghWm3ufinBiXkWXsgGr+QysQOg1dXLjcCVxkJW+inmsR 5SRQ9bl9zggGZ19PIXfU++PhaUZjF0dhlkgCcTNxAR5BPzAxHLFkfnqk1pl8u4OsKzzm ETvKAa4j6kO2SMnzlgcln94qKwsQxlVFJLgGigpQnt5m3gb1uHzU8MWQXL4e+yTES7Bq By3st1ubPYdRpoL7KLtPbVgVPpJLjrsiHxMmYNGYdyxLK78gSeaFWG+jWnhIaNS6IgsV YL0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="RYWrCao/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i185-20020a636dc2000000b004a03cdc3f29si6518750pgc.140.2023.01.25.12.32.12; Wed, 25 Jan 2023 12:32:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="RYWrCao/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236376AbjAYUMI (ORCPT + 99 others); Wed, 25 Jan 2023 15:12:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46786 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236353AbjAYUMD (ORCPT ); Wed, 25 Jan 2023 15:12:03 -0500 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E6C795D90F; Wed, 25 Jan 2023 12:11:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1674677495; x=1706213495; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=o+ZGOHz8ijK9H+L7WtFqSqHxlRgWx6avT4sRFNpRp9Y=; b=RYWrCao/9Oq9LHh3AJg9okif5Lrotr0WovidRrbRkOce7OtQiGQ4jC/5 G3GZnikn7iSLe9bUfkY/It2CspXOLSg31uvWr3Tyv177gjb9qQ11wb2WG nQdHbNsJllmVSJy0Evu1hCjVOJpxHGSYc89FQAXqIafDt63rSHedTzdJi lDkZ+cfWypyJo1AD1sakfsJAENOVzjtM9EqFKpZPlKyt1/wjBQ3FZTB72 9QwF5gTp6UvY8ybwRERvzJOBif/sWto5Kr45BiFQncB2X0sSJY8R6z9HT l19YpCXWo7pDTnjdxTDPnVnzTHRcmaomcDdVQ/4+vlkPsFIqiRV4fZH9f A==; X-IronPort-AV: E=McAfee;i="6500,9779,10601"; a="326694799" X-IronPort-AV: E=Sophos;i="5.97,246,1669104000"; d="scan'208";a="326694799" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jan 2023 12:09:55 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10601"; a="770871663" X-IronPort-AV: E=Sophos;i="5.97,246,1669104000"; d="scan'208";a="770871663" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga002.fm.intel.com with ESMTP; 25 Jan 2023 12:09:52 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 57E9636E; Wed, 25 Jan 2023 22:10:25 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , Bartosz Golaszewski , Christophe Leroy , Dmitry Torokhov , linux-gpio@vger.kernel.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Linus Walleij , Bartosz Golaszewski , Arnd Bergmann Subject: [PATCH v1 5/5] gpio: Clean up headers Date: Wed, 25 Jan 2023 22:10:20 +0200 Message-Id: <20230125201020.10948-6-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230125201020.10948-1-andriy.shevchenko@linux.intel.com> References: <20230125201020.10948-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756027939837214796?= X-GMAIL-MSGID: =?utf-8?q?1756027939837214796?= There is a few things done: - include only the headers we are direct user of - when pointer is in use, provide a forward declaration - add missing headers - group generic headers and subsystem headers - sort each group alphabetically Signed-off-by: Andy Shevchenko --- include/asm-generic/gpio.h | 8 -------- include/linux/gpio.h | 9 +++------ include/linux/gpio/consumer.h | 14 ++++++++++---- include/linux/gpio/driver.h | 34 ++++++++++++++++++++++++---------- 4 files changed, 37 insertions(+), 28 deletions(-) diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h index 22cb8c9efc1d..5d4d3529324c 100644 --- a/include/asm-generic/gpio.h +++ b/include/asm-generic/gpio.h @@ -3,11 +3,9 @@ #define _ASM_GENERIC_GPIO_H #include -#include #ifdef CONFIG_GPIOLIB -#include #include #include @@ -24,12 +22,7 @@ */ #define GPIO_DYNAMIC_BASE 512 -struct device; struct gpio; -struct seq_file; -struct module; -struct device_node; -struct gpio_desc; /* Always use the library code for GPIO management calls, * or when sleeping may be involved. @@ -60,7 +53,6 @@ static inline void gpio_set_value_cansleep(unsigned gpio, int value) return gpiod_set_raw_value_cansleep(gpio_to_desc(gpio), value); } - /* A platform's code may want to inline the I/O calls when * the GPIO is constant and refers to some always-present controller, * giving direct access to chip registers and tight bitbanging loops. diff --git a/include/linux/gpio.h b/include/linux/gpio.h index 85beb236c925..cc28c8d5e93c 100644 --- a/include/linux/gpio.h +++ b/include/linux/gpio.h @@ -12,7 +12,7 @@ #ifndef __LINUX_GPIO_H #define __LINUX_GPIO_H -#include +struct device; /* see Documentation/driver-api/gpio/legacy.rst */ @@ -85,20 +85,17 @@ static inline int gpio_to_irq(unsigned int gpio) /* CONFIG_GPIOLIB: bindings for managed devices that want to request gpios */ -struct device; - int devm_gpio_request(struct device *dev, unsigned gpio, const char *label); int devm_gpio_request_one(struct device *dev, unsigned gpio, unsigned long flags, const char *label); #else /* ! CONFIG_GPIOLIB */ -#include #include #include -struct device; -struct gpio_chip; +#include +#include static inline bool gpio_is_valid(int number) { diff --git a/include/linux/gpio/consumer.h b/include/linux/gpio/consumer.h index 5432e5d5fbfb..1c4385a00f88 100644 --- a/include/linux/gpio/consumer.h +++ b/include/linux/gpio/consumer.h @@ -3,15 +3,14 @@ #define __LINUX_GPIO_CONSUMER_H #include -#include -#include -#include +#include struct acpi_device; struct device; struct fwnode_handle; -struct gpio_desc; + struct gpio_array; +struct gpio_desc; /** * struct gpio_descs - Struct containing an array of descriptors that can be @@ -185,8 +184,11 @@ struct gpio_desc *devm_fwnode_gpiod_get_index(struct device *dev, #else /* CONFIG_GPIOLIB */ +#include #include +#include + static inline int gpiod_count(struct device *dev, const char *con_id) { return 0; @@ -616,6 +618,8 @@ struct gpio_desc *acpi_get_and_request_gpiod(char *path, unsigned int pin, char #else /* CONFIG_GPIOLIB && CONFIG_ACPI */ +#include + static inline int acpi_dev_add_driver_gpios(struct acpi_device *adev, const struct acpi_gpio_mapping *gpios) { @@ -647,6 +651,8 @@ void gpiod_unexport(struct gpio_desc *desc); #else /* CONFIG_GPIOLIB && CONFIG_GPIO_SYSFS */ +#include + static inline int gpiod_export(struct gpio_desc *desc, bool direction_may_change) { diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h index caf2376dd98b..208c7cfeadb2 100644 --- a/include/linux/gpio/driver.h +++ b/include/linux/gpio/driver.h @@ -2,26 +2,29 @@ #ifndef __LINUX_GPIO_DRIVER_H #define __LINUX_GPIO_DRIVER_H -#include -#include -#include +#include #include +#include #include -#include #include #include +#include #include +#ifdef CONFIG_GENERIC_MSI_IRQ #include +#endif -struct gpio_desc; +struct device; +struct irq_chip; +struct irq_data; +struct module; struct of_phandle_args; +struct pinctrl_dev; struct seq_file; -struct gpio_device; -struct module; -enum gpiod_flags; -enum gpio_lookup_flags; +struct gpio_desc; +struct gpio_device; struct gpio_chip; union gpio_irq_fwspec { @@ -691,6 +694,10 @@ bool gpiochip_irqchip_irq_valid(const struct gpio_chip *gc, int gpiochip_irqchip_add_domain(struct gpio_chip *gc, struct irq_domain *domain); #else + +#include +#include + static inline int gpiochip_irqchip_add_domain(struct gpio_chip *gc, struct irq_domain *domain) { @@ -752,6 +759,9 @@ gpiochip_remove_pin_ranges(struct gpio_chip *gc) #ifdef CONFIG_GPIOLIB +enum gpiod_flags; +enum gpio_lookup_flags; + struct gpio_desc *gpiochip_request_own_desc(struct gpio_chip *gc, unsigned int hwnum, const char *label, @@ -768,8 +778,12 @@ struct gpio_chip *gpiod_to_chip(const struct gpio_desc *desc); #else /* CONFIG_GPIOLIB */ -#include +#include + +#include + #include +#include static inline struct gpio_desc *gpiochip_request_own_desc(struct gpio_chip *gc, unsigned int hwnum,