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 1535CC433F5 for ; Sat, 9 Apr 2022 13:35:16 +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:In-Reply-To:From:References:Cc:To: Subject:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=c4kVFn2/ZMlwbeFwwXkG+dt6qrdpeY8LewQ+L5yic8s=; b=22Xkcc9Edp4XPh G4FA0cOwkjXsfy7uRLPSUei5xGTBDRMFaW8CwXdUs+pNnLax6O3AvTtbOGw7LNs4bFZuJ8Wkry47i vKS3rzQxEb1HABE8cfOXMSTI+ITkS/p8NjKMQr7dAIhZCoxfv4iJWBOVKZd9Bhgik267lJJCAhQtS fyINkjMLgSUiXWn2VC8UshpfGb1da2pj3ggxDjEm/Bn5vJNIr18QMJPz7n11hdWKUl+yHelb2bdw/ 4pKU6bwjlavsAAzs3EdFyEDa7Xc02kgXBRv6XNr5SE9WL85YWLCjwR1w0Cn92CDDR0WpaNSBluHgg 2lZCFltzJLUwxWoTgYLg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ndBE0-003EpH-V8; Sat, 09 Apr 2022 13:34:01 +0000 Received: from mail-ej1-x62c.google.com ([2a00:1450:4864:20::62c]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ndBDt-003Eny-T8 for linux-arm-kernel@lists.infradead.org; Sat, 09 Apr 2022 13:33:58 +0000 Received: by mail-ej1-x62c.google.com with SMTP id p15so22326543ejc.7 for ; Sat, 09 Apr 2022 06:33:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=LO7mTJuUjnyguTxwzU4yCMRsr4W3KT8BOY3t4LlaHc0=; b=NSPuRoYHtyOw+PcsMZMVtuInfF33reqEX80RTlsMYF96wzkfEaIKPTkf0zDLCojnUm 7GdAM9ck8RvQnAE0+woC+0Cz0hKM9k7ConH5cc8CM3A80Q22AF30cnY5tVI5IrRhfRiq fUs2YJsfoDOLl23ee7Kfwr0FQg7iHJDavcGzo6omSFqqR7QkLBp6xvW024IMq4mk8XcH aI+dI62HLCe60/HRWGhTBdhYz6pdh05BA5qgDsK/MG0ybk9Vjkb5p0YHoofix6xORs7e TQjQGp1ld64FVyUXf1RkiYaMnO4jpnKDkq/gesw7lqgg3jkxwTzzbP8gH8cCxOWqkIK3 2lCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=LO7mTJuUjnyguTxwzU4yCMRsr4W3KT8BOY3t4LlaHc0=; b=ug9Q4GvaFtWfozAg3OYz80YM+l8S/MfCDuVcAqWSxX03AUwt5CRxH3f+q1gy0J6uT9 NtL6c5tzBj3lwR6e9+/6PUhViDQJy+x6IxMmN/5J41CvzlzcxyuHFYryFHD9J2ye5jx7 0HntOMOOwwGXHeB4GUm5O4VVG+1D0pav5Ccz49z/2B8kLHs0/nhZgr0cf9M6uYVqfeMW riqvgXM0pCcEhXEeAmWyFAxvzB8ZUAp0nqSOQbpRgP4G2F8bcP7RfMKgXf10QFnC09zq 95UtcvE4WbQ7rI32c3i9o5cQDPWwl+vWnnklIEgUCkJuGZCQ102AD3m/TBhQITtkHC8O LKyw== X-Gm-Message-State: AOAM531yOiQclwapPn4H+069f5xfsXLpqKmxKhE0Hwt7gaWwhu9zC+gI i71ZGk10r+cfVDK7zV4W9d8LkQ== X-Google-Smtp-Source: ABdhPJw7Y7cYYHPAiiiP0NIjLn5Hmp6+EKk8JZn75hkyokX3E/0ElhCjWMr9REwrEdqcx3UfkRN70w== X-Received: by 2002:a17:906:d204:b0:6d6:df17:835e with SMTP id w4-20020a170906d20400b006d6df17835emr22437048ejz.20.1649511231518; Sat, 09 Apr 2022 06:33:51 -0700 (PDT) Received: from [192.168.0.188] (xdsl-188-155-201-27.adslplus.ch. [188.155.201.27]) by smtp.gmail.com with ESMTPSA id q22-20020a170906771600b006cf8a37ebf5sm9774514ejm.103.2022.04.09.06.33.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 09 Apr 2022 06:33:51 -0700 (PDT) Message-ID: <3b527700-444e-1f6e-fee1-5cd6ed2ef7f9@linaro.org> Date: Sat, 9 Apr 2022 15:33:49 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH v4 05/13] pinctrl: samsung: Switch to use for_each_gpiochip_node() helper Content-Language: en-US To: Andy Shevchenko , Krzysztof Kozlowski Cc: Qianggui Song , Geert Uytterhoeven , Marc Zyngier , Fabien Dessenne , Linus Walleij , linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org, openbmc@lists.ozlabs.org, linux-renesas-soc@vger.kernel.org, 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 , Bartosz Golaszewski , Philipp Zabel References: <20220401103604.8705-1-andriy.shevchenko@linux.intel.com> <20220401103604.8705-6-andriy.shevchenko@linux.intel.com> From: Krzysztof Kozlowski In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220409_063353_992015_06C11069 X-CRM114-Status: GOOD ( 18.18 ) 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 08/04/2022 17:39, Andy Shevchenko wrote: > On Fri, Apr 08, 2022 at 05:22:21PM +0200, Krzysztof Kozlowski wrote: >> On 01/04/2022 12:35, Andy Shevchenko wrote: >>> Switch the code to use for_each_gpiochip_node() helper. > > (...) > >>> /* >>> * Iterate over all driver pin banks to find one matching the name of node, >>> * skipping optional "-gpio" node suffix. When found, assign node to the bank. >>> */ >>> -static void samsung_banks_of_node_get(struct device *dev, >>> - struct samsung_pinctrl_drv_data *d, >>> - struct device_node *node) >>> +static void samsung_banks_node_get(struct device *dev, struct samsung_pinctrl_drv_data *d) >> >> This is worth simplification anyway, so please split it to separate patch. > > Not sure what to do and why it worth an additional churn. Makes this change smaller so it's easier to review. > >>> { >>> const char *suffix = "-gpio-bank"; >>> struct samsung_pin_bank *bank; >>> - struct device_node *child; >>> + struct fwnode_handle *child; >>> /* Pin bank names are up to 4 characters */ >>> char node_name[20]; >>> unsigned int i; >>> @@ -1038,17 +1037,17 @@ static void samsung_banks_of_node_get(struct device *dev, >>> continue; >>> } >>> >>> - for_each_child_of_node(node, child) { >>> - if (!of_find_property(child, "gpio-controller", NULL)) >>> - continue; >> >> This does not look equivalent. There are nodes without this property. > > Not sure I understand why not. The macro checks for the property and > iterates over nodes that have this property. > > Can you elaborate, please? Eh, my bad, it is equivalent. > >>> - if (of_node_name_eq(child, node_name)) >>> + for_each_gpiochip_node(dev, child) { >>> + struct device_node *np = to_of_node(child); >>> + >>> + if (of_node_name_eq(np, node_name)) >>> break; >>> - else if (of_node_name_eq(child, bank->name)) >>> + if (of_node_name_eq(np, bank->name)) >>> break; >>> } >> >> This patch has to wait till someone provides you a tested-by. I might do >> it around next week. > > Fine with me, I will drop it from my repo for now. Best regards, Krzysztof _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel