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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DE132C433F5 for ; Tue, 5 Apr 2022 12:13:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=c3p5dTnjzK9IhfGPcDEweJsRLgdzPkOnXNaqqJZIW1I=; b=h56+A80L1Z5EXb E3weOwBpAnmz0bDdRbOtZGsoMlhrtHr9YecQXpaKFB3uX4fOV0MKhikdC8kC7r2ouk+Qdeghntjxj uNxI3qTpdTIVH9qTVxo6XA4SKQHYbvHLXN21rtHHzuYxfvOBHfAm8FBoWIPVHjva6wz96RXJgC/Pb qoPFxqNeA65g4K5jJixkREPB1Azcj3D1uWgaZYkNBrGAoUj/9lKsOcI6doySmTagtu7qOrCN76peN 2gGc5Y5Hn8ONEMk8oVAxgEzKbFfUl1Rd55j97XzwmlWzVjwwPSke26VLwwOjKE1YHACQ3vYla9tce TchKGVvzZeYMZvWCxA6w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nbi3g-000vo5-GN; Tue, 05 Apr 2022 12:13:16 +0000 Received: from mail-ed1-x52b.google.com ([2a00:1450:4864:20::52b]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nbi3V-000vjj-3m for linux-amlogic@lists.infradead.org; Tue, 05 Apr 2022 12:13:07 +0000 Received: by mail-ed1-x52b.google.com with SMTP id g20so14634068edw.6 for ; Tue, 05 Apr 2022 05:13:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=MPvaywVSzLQsDypuAZWtv58R2kwucV8I6O2XfMn8CQ0=; b=K14qIg6mMRkLPr4OiAE9Cpu4U+tbA3P91G4RHNesqQyi39uh/EQnwZQg47N4I1HFGa VaAqAu3jWh3kOpu/vkFSBsrj1wlQcT4uTVYmxgreiwzNn3G4cU5MD051hiN68+YGuGmY cWQCyd0GCycNunk8Wgl1kQf10tQCes43bS272nOze5ZBtFeq/ovHUODYcVLcH0YQyWiB gjAhy8svdiXMCYEiMuuZdKtDH70VTPDrXTpKYTpEPlY5O8uUWZtdPs0P7eBHzY2zgCU7 sPECd23ZpDiAOHiDWi0xlIBEdLwSexx11IbYL6ItqaYg5rExP1x8AxgVNc8xIyvnJDdV uHvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=MPvaywVSzLQsDypuAZWtv58R2kwucV8I6O2XfMn8CQ0=; b=nni4jOHfMjMh3MQ4d9FejwU1dVqcc9sltZNFDuCgGFSvE1p3G/I2fL8hmh4ghyBl3f En2LVfSfaHmgJPAZMFGfeCHibRL4ss9/yqhVp1TQGkcHEcd5BHyURyKaNArC9LMVIwcX T8J+1U8v0vWbJ03LkWvOy3qu4lHhCVsTdu8kmzYd/BbsWYuezJhrGpfVZPXmFOwfQYPY PLIeQ6bH//LYAGg1Gl9Ae5xmtcstDZeVF6nanUu8AsOXdpqLqDb99r9SeCESYPTxL4fd actlY6cv5Pj+PsjQQGid2P12dTDOIqckU3869YRf6Yo7d2NdaPB9VslOj8zISoAkk/2t IQQg== X-Gm-Message-State: AOAM533IkmrsrqfblS1Pfn1EW22GgC/HRJIE8CLes57Q0fos8Rh4TNkt UgAkHN+2dvknCvZurEK6Nl8KaJkVl5Meg1th0Q/Z5Q== X-Google-Smtp-Source: ABdhPJyK6ciXtk4jJTmoikX0fzgqwOpbxHs/TrQKtZElemmsFiXP5Rij+6j+c5XTQ4r1vrmfsngJLLE7wspd4bNThOM= X-Received: by 2002:a05:6402:d4c:b0:410:a415:fd95 with SMTP id ec12-20020a0564020d4c00b00410a415fd95mr3310237edb.288.1649160780633; Tue, 05 Apr 2022 05:13:00 -0700 (PDT) MIME-Version: 1.0 References: <20220401103604.8705-1-andriy.shevchenko@linux.intel.com> <20220401103604.8705-2-andriy.shevchenko@linux.intel.com> In-Reply-To: <20220401103604.8705-2-andriy.shevchenko@linux.intel.com> From: Bartosz Golaszewski Date: Tue, 5 Apr 2022 14:12:50 +0200 Message-ID: Subject: Re: [PATCH v4 01/13] gpiolib: Introduce for_each_gpiochip_node() loop helper To: Andy Shevchenko Cc: Qianggui Song , Geert Uytterhoeven , Krzysztof Kozlowski , Marc Zyngier , Fabien Dessenne , Linus Walleij , "open list:GPIO SUBSYSTEM" , Linux ARM , linux-amlogic@lists.infradead.org, Linux Kernel Mailing List , OpenBMC Maillist , Linux-Renesas , linux-samsung-soc@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Andrew Lunn , Gregory Clement , Sebastian Hesselbarth , Avi Fishman , Tomer Maimon , Tali Perry , Patrick Venture , Nancy Yuen , Benjamin Fair , Tomasz Figa , Sylwester Nawrocki , Alim Akhtar , Maxime Coquelin , Alexandre Torgue , Philipp Zabel X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220405_051305_180914_A7EE9836 X-CRM114-Status: GOOD ( 15.84 ) X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=archiver.kernel.org@lists.infradead.org On Fri, Apr 1, 2022 at 12:36 PM Andy Shevchenko wrote: > > Introduce for_each_gpiochip_node() loop helper which iterates over > the GPIO controller child nodes of a given device. > > Signed-off-by: Andy Shevchenko > Reviewed-by: Geert Uytterhoeven > Tested-by: Geert Uytterhoeven > --- > include/linux/gpio/driver.h | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h > index 98c93510640e..bfc91f122d5f 100644 > --- a/include/linux/gpio/driver.h > +++ b/include/linux/gpio/driver.h > @@ -3,13 +3,14 @@ > #define __LINUX_GPIO_DRIVER_H > > #include > -#include > #include > #include > #include > #include > #include > #include > +#include > +#include > > struct gpio_desc; > struct of_phandle_args; > @@ -750,4 +751,8 @@ static inline void gpiochip_unlock_as_irq(struct gpio_chip *gc, > } > #endif /* CONFIG_GPIOLIB */ > > +#define for_each_gpiochip_node(dev, child) \ > + device_for_each_child_node(dev, child) \ > + if (!fwnode_property_present(child, "gpio-controller")) {} else > + > #endif /* __LINUX_GPIO_DRIVER_H */ > -- > 2.35.1 > Acked-by: Bartosz Golaszewski _______________________________________________ linux-amlogic mailing list linux-amlogic@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-amlogic 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4F9B1C433EF for ; Tue, 5 Apr 2022 12:15:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=JmDw9Jb5JvbtHka2GEv/weuHsaDu5B3dZsMh/uA4Sdo=; b=LM1AsQkNeZiV+u hnT92ef53/eslJnPv9Ax1rCb07z5ori4tBJDmI3J6ZZgA74DkDJ6zCu7n6C/8BV89aO7BkkAgYdYh YmNLxmPu0wEo3S5TunZNrd3lfIepx1Wi6TPGbO+IBeKxobVqosUeczhBQ5bUSuuIlcLws8+5OrQFG cquveulxzo4OyWnd6TQhKWai+b4zMsahVqyDhAECPJSimQSs2SckJxjplBIx4evW4VMPIFnK1KPYk Yg0XqeMKBMy8Yt+8P+HqOzHVIQEy7mKSie1Z3pH7EMpeVd4k3WUAYx6DWXVF7klsBXPzffhLo+ZZe cT5yL1mJZ2fHtzm9wevw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nbi3Y-000vlr-3X; Tue, 05 Apr 2022 12:13:08 +0000 Received: from mail-ed1-x52f.google.com ([2a00:1450:4864:20::52f]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nbi3U-000vjk-J5 for linux-arm-kernel@lists.infradead.org; Tue, 05 Apr 2022 12:13:06 +0000 Received: by mail-ed1-x52f.google.com with SMTP id b24so14611067edu.10 for ; Tue, 05 Apr 2022 05:13:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=MPvaywVSzLQsDypuAZWtv58R2kwucV8I6O2XfMn8CQ0=; b=K14qIg6mMRkLPr4OiAE9Cpu4U+tbA3P91G4RHNesqQyi39uh/EQnwZQg47N4I1HFGa VaAqAu3jWh3kOpu/vkFSBsrj1wlQcT4uTVYmxgreiwzNn3G4cU5MD051hiN68+YGuGmY cWQCyd0GCycNunk8Wgl1kQf10tQCes43bS272nOze5ZBtFeq/ovHUODYcVLcH0YQyWiB gjAhy8svdiXMCYEiMuuZdKtDH70VTPDrXTpKYTpEPlY5O8uUWZtdPs0P7eBHzY2zgCU7 sPECd23ZpDiAOHiDWi0xlIBEdLwSexx11IbYL6ItqaYg5rExP1x8AxgVNc8xIyvnJDdV uHvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=MPvaywVSzLQsDypuAZWtv58R2kwucV8I6O2XfMn8CQ0=; b=zNIGEUZKvdjqmnv3+j0eNi9I1bihwtdYB9nzW/iE545w+4y7QKdEX6AYG5pbsXOzwR FR6D4QFtpAEmAMGt+fobg91tXydTSIqIajT3X3TSeBdtZT2Mven4FkSt4bsoB3BuObOq yOYx8gO06ukMzVxItJemtk2UsagMBZgNAksHJ0F5DMQYU+6pWTbKGlMfjEU9IMRwD9E2 hvnuSHRwcm8aDJ0ks9Ve87IZNumbmsSXQwBa9Rl/m4VWLwuAAlTQALum7oSev/zK/LMh gACXgvwgZwhC7NSiFrnKLxwjn98zvr6kdY5tG1rX7BZMye1k2b/lkbihHqVip4qHZBAM CD0w== X-Gm-Message-State: AOAM531WKbr4yY+WrrEZ2c0BJZz14q2nSA4Fb30UwFZ3MKY65Wo4qKPq ksnctQfrKcNfFeOdi1KP9ryJfns3RSSTmsciwAoTRg== X-Google-Smtp-Source: ABdhPJyK6ciXtk4jJTmoikX0fzgqwOpbxHs/TrQKtZElemmsFiXP5Rij+6j+c5XTQ4r1vrmfsngJLLE7wspd4bNThOM= X-Received: by 2002:a05:6402:d4c:b0:410:a415:fd95 with SMTP id ec12-20020a0564020d4c00b00410a415fd95mr3310237edb.288.1649160780633; Tue, 05 Apr 2022 05:13:00 -0700 (PDT) MIME-Version: 1.0 References: <20220401103604.8705-1-andriy.shevchenko@linux.intel.com> <20220401103604.8705-2-andriy.shevchenko@linux.intel.com> In-Reply-To: <20220401103604.8705-2-andriy.shevchenko@linux.intel.com> From: Bartosz Golaszewski Date: Tue, 5 Apr 2022 14:12:50 +0200 Message-ID: Subject: Re: [PATCH v4 01/13] gpiolib: Introduce for_each_gpiochip_node() loop helper To: Andy Shevchenko Cc: Qianggui Song , Geert Uytterhoeven , Krzysztof Kozlowski , Marc Zyngier , Fabien Dessenne , Linus Walleij , "open list:GPIO SUBSYSTEM" , Linux ARM , linux-amlogic@lists.infradead.org, Linux Kernel Mailing List , OpenBMC Maillist , Linux-Renesas , linux-samsung-soc@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Andrew Lunn , Gregory Clement , Sebastian Hesselbarth , Avi Fishman , Tomer Maimon , Tali Perry , Patrick Venture , Nancy Yuen , Benjamin Fair , Tomasz Figa , Sylwester Nawrocki , Alim Akhtar , Maxime Coquelin , Alexandre Torgue , Philipp Zabel X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220405_051304_890837_B7D04B37 X-CRM114-Status: GOOD ( 17.19 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Apr 1, 2022 at 12:36 PM Andy Shevchenko wrote: > > Introduce for_each_gpiochip_node() loop helper which iterates over > the GPIO controller child nodes of a given device. > > Signed-off-by: Andy Shevchenko > Reviewed-by: Geert Uytterhoeven > Tested-by: Geert Uytterhoeven > --- > include/linux/gpio/driver.h | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h > index 98c93510640e..bfc91f122d5f 100644 > --- a/include/linux/gpio/driver.h > +++ b/include/linux/gpio/driver.h > @@ -3,13 +3,14 @@ > #define __LINUX_GPIO_DRIVER_H > > #include > -#include > #include > #include > #include > #include > #include > #include > +#include > +#include > > struct gpio_desc; > struct of_phandle_args; > @@ -750,4 +751,8 @@ static inline void gpiochip_unlock_as_irq(struct gpio_chip *gc, > } > #endif /* CONFIG_GPIOLIB */ > > +#define for_each_gpiochip_node(dev, child) \ > + device_for_each_child_node(dev, child) \ > + if (!fwnode_property_present(child, "gpio-controller")) {} else > + > #endif /* __LINUX_GPIO_DRIVER_H */ > -- > 2.35.1 > Acked-by: Bartosz Golaszewski _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel 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 8A748C433F5 for ; Tue, 5 Apr 2022 14:33:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238743AbiDEOex (ORCPT ); Tue, 5 Apr 2022 10:34:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53022 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377189AbiDENMq (ORCPT ); Tue, 5 Apr 2022 09:12:46 -0400 Received: from mail-ed1-x531.google.com (mail-ed1-x531.google.com [IPv6:2a00:1450:4864:20::531]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 177E1121504 for ; Tue, 5 Apr 2022 05:13:02 -0700 (PDT) Received: by mail-ed1-x531.google.com with SMTP id w18so8389505edi.13 for ; Tue, 05 Apr 2022 05:13:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=MPvaywVSzLQsDypuAZWtv58R2kwucV8I6O2XfMn8CQ0=; b=K14qIg6mMRkLPr4OiAE9Cpu4U+tbA3P91G4RHNesqQyi39uh/EQnwZQg47N4I1HFGa VaAqAu3jWh3kOpu/vkFSBsrj1wlQcT4uTVYmxgreiwzNn3G4cU5MD051hiN68+YGuGmY cWQCyd0GCycNunk8Wgl1kQf10tQCes43bS272nOze5ZBtFeq/ovHUODYcVLcH0YQyWiB gjAhy8svdiXMCYEiMuuZdKtDH70VTPDrXTpKYTpEPlY5O8uUWZtdPs0P7eBHzY2zgCU7 sPECd23ZpDiAOHiDWi0xlIBEdLwSexx11IbYL6ItqaYg5rExP1x8AxgVNc8xIyvnJDdV uHvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=MPvaywVSzLQsDypuAZWtv58R2kwucV8I6O2XfMn8CQ0=; b=ZT7/TyuwsL9GRzJh/Cb288SqDrs3QM/AnhNUsVjYeEyGJ89Vrjm8xgbmNbctcfY7kd fqc/3y87/d4iJxKcTE5S2uhjB+1Nt+xtsHi5h8gWI75/oRc1sUhpk711TsQWD7JyrVIp cSsr31gWhEy8iPKbNKhj4MK9XTTw5GGW7H5TjGcbj9++PP60AaUEhSB5sNIxj7JdJ3H7 cVR3zFoGcZBCxQ2MBLA42gIPHnRVCTRUhHXy0/fnRW32n/CaxBHQjOEwVHCZ2eliGZt1 ED/McTozLn4PVhwFUPGZnv4KPBnz6LVNh7NhakxNuFoGzo2vEMs18jmvkqXkgVsMij59 EeiQ== X-Gm-Message-State: AOAM530XnQaRo58LbB+8Va5/kkO5EhNmmENu9Em0q7HzH9kWzko3uC9V TVEAR/Riw1+u/XO8nQiQI7D8eEiwgFxUIhhAbJYO/w== X-Google-Smtp-Source: ABdhPJyK6ciXtk4jJTmoikX0fzgqwOpbxHs/TrQKtZElemmsFiXP5Rij+6j+c5XTQ4r1vrmfsngJLLE7wspd4bNThOM= X-Received: by 2002:a05:6402:d4c:b0:410:a415:fd95 with SMTP id ec12-20020a0564020d4c00b00410a415fd95mr3310237edb.288.1649160780633; Tue, 05 Apr 2022 05:13:00 -0700 (PDT) MIME-Version: 1.0 References: <20220401103604.8705-1-andriy.shevchenko@linux.intel.com> <20220401103604.8705-2-andriy.shevchenko@linux.intel.com> In-Reply-To: <20220401103604.8705-2-andriy.shevchenko@linux.intel.com> From: Bartosz Golaszewski Date: Tue, 5 Apr 2022 14:12:50 +0200 Message-ID: Subject: Re: [PATCH v4 01/13] gpiolib: Introduce for_each_gpiochip_node() loop helper To: Andy Shevchenko Cc: Qianggui Song , Geert Uytterhoeven , Krzysztof Kozlowski , Marc Zyngier , Fabien Dessenne , Linus Walleij , "open list:GPIO SUBSYSTEM" , Linux ARM , linux-amlogic@lists.infradead.org, Linux Kernel Mailing List , OpenBMC Maillist , Linux-Renesas , linux-samsung-soc@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Andrew Lunn , Gregory Clement , Sebastian Hesselbarth , Avi Fishman , Tomer Maimon , Tali Perry , Patrick Venture , Nancy Yuen , Benjamin Fair , Tomasz Figa , Sylwester Nawrocki , Alim Akhtar , Maxime Coquelin , Alexandre Torgue , Philipp Zabel Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org On Fri, Apr 1, 2022 at 12:36 PM Andy Shevchenko wrote: > > Introduce for_each_gpiochip_node() loop helper which iterates over > the GPIO controller child nodes of a given device. > > Signed-off-by: Andy Shevchenko > Reviewed-by: Geert Uytterhoeven > Tested-by: Geert Uytterhoeven > --- > include/linux/gpio/driver.h | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h > index 98c93510640e..bfc91f122d5f 100644 > --- a/include/linux/gpio/driver.h > +++ b/include/linux/gpio/driver.h > @@ -3,13 +3,14 @@ > #define __LINUX_GPIO_DRIVER_H > > #include > -#include > #include > #include > #include > #include > #include > #include > +#include > +#include > > struct gpio_desc; > struct of_phandle_args; > @@ -750,4 +751,8 @@ static inline void gpiochip_unlock_as_irq(struct gpio_chip *gc, > } > #endif /* CONFIG_GPIOLIB */ > > +#define for_each_gpiochip_node(dev, child) \ > + device_for_each_child_node(dev, child) \ > + if (!fwnode_property_present(child, "gpio-controller")) {} else > + > #endif /* __LINUX_GPIO_DRIVER_H */ > -- > 2.35.1 > Acked-by: Bartosz Golaszewski