Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp6766428rwb; Tue, 15 Nov 2022 03:29:49 -0800 (PST) X-Google-Smtp-Source: AA0mqf6ZARyjAuwGGHoXdPf/UZlwoRfKaIsVyPik5wHPVXfyN8fY9gwVSK/9JPBIdLL8p95WlsaQ X-Received: by 2002:a17:902:db09:b0:187:85d:2517 with SMTP id m9-20020a170902db0900b00187085d2517mr3526473plx.35.1668511789141; Tue, 15 Nov 2022 03:29:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668511789; cv=none; d=google.com; s=arc-20160816; b=pCxj7gSGqW0hC+Igj6vBavU0R+7kGRmMr0Ze0J/k5IZgLHKa3CLf47JztWw0229ha1 E2GBASJucKHtlW4DjtaQavRV1ki5eTpX+H7KPe8JLyFxubFXDFPyWc9AnO9EoSNUXUBy O8sk9QfvJMKkk8PPcFOzfBnLCB8RfWQb6sai3Kqr1R8hFNyTuS72NmlWwAT83AOPuuPt ncUzWdJcpKv55aU7wgRMoadExU0iZ2vzkeEMaPVDA+om4ZunqqJCEEx1jsvinjRkDRZs WdN1jj85nGgvcAkZzXz0Q2vfjObDg2CUZxl4uFWvAfzzNuY8YrA5PTztOgBeiAipVP4M s09A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=shAcRWILAJm2cGLIIwi6blyQz3hyqXRRFwP8TwIT5YM=; b=EH8+tONpWi0xSr+MWt23C5b+eKrB1C1iBMLvl9tlPHtvBR918/xEYgFInwLOsNPSGe /uzbObdamKBcd0e9rzjgDhojdElq1zt1HmBnmGSIq7wVQ3A5SA3Aob8zqfK8ZwlIRfc+ T8BvRImdb+zHcHub0OS/EPZ8E3JFevYuJTenHkucYrlD/hrgYimitV6f4dlGV4p0DyH1 Gr2bnOEH24xpUAf81qyu7+UTcrsKUIJsc9QTGcx9R+3aF2dm7rGc6FvbSkFibK07nmNC PhMVtlgomWyt/wxXChWH4vdubFpZBpboDRCAh2A9hS52sr6n3EKTyh9ll3LbD1kAA0AQ /PAw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t14-20020a63224e000000b0046265702353si12788889pgm.203.2022.11.15.03.29.37; Tue, 15 Nov 2022 03:29:49 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229705AbiKOLPL (ORCPT + 90 others); Tue, 15 Nov 2022 06:15:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51900 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229545AbiKOLOt (ORCPT ); Tue, 15 Nov 2022 06:14:49 -0500 Received: from mail-qk1-f178.google.com (mail-qk1-f178.google.com [209.85.222.178]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C6724F48; Tue, 15 Nov 2022 03:13:31 -0800 (PST) Received: by mail-qk1-f178.google.com with SMTP id d7so6836355qkk.3; Tue, 15 Nov 2022 03:13:31 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=shAcRWILAJm2cGLIIwi6blyQz3hyqXRRFwP8TwIT5YM=; b=aLi+373dOeQ/WxPGp6l+pOD1OwLniHqgDAHvxAtDENaFnYVt0RBaM2TD/4QLm4dxft wmMbrMysZZl8/rDtkfZ2NDbOVtbwlk0l3pm5IQSj15+P+4jyWS6YJprUQE8YTcjUBmiJ xhVKijgFcx2Mqm26hBMfIKNnC24NKZitNRzIzuxY9x/bqrfR9g7NaLulG6pFIUZmDJRK wy7UIgxq9ds5len3FcRz+cdPu8I5dl96Uqpfv4CjxhLxspQx1RJDWOg7Kah+/7MQrXn9 8YByLyaMmWIUjnZvK6r1K43FoQ9xeeeI40Fnim1ZEGfOkO86w7b9NbKI8w6x4KtmcOOZ X1xQ== X-Gm-Message-State: ANoB5pmEphq8ImDb0FcZ/gxQQ4CSWSX5N5g/f4Heo9KGR7pGqHN6TRWQ niuQbaqhHCmyg7Nt1WE/zMQhRwpoIxLHtw== X-Received: by 2002:ae9:e30d:0:b0:6f1:187c:8f79 with SMTP id v13-20020ae9e30d000000b006f1187c8f79mr14316594qkf.593.1668510810714; Tue, 15 Nov 2022 03:13:30 -0800 (PST) Received: from mail-yw1-f177.google.com (mail-yw1-f177.google.com. [209.85.128.177]) by smtp.gmail.com with ESMTPSA id ay40-20020a05620a17a800b006cbe3be300esm8015104qkb.12.2022.11.15.03.13.29 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 15 Nov 2022 03:13:30 -0800 (PST) Received: by mail-yw1-f177.google.com with SMTP id 00721157ae682-3704852322fso133635577b3.8; Tue, 15 Nov 2022 03:13:29 -0800 (PST) X-Received: by 2002:a81:4dc3:0:b0:370:61f5:b19e with SMTP id a186-20020a814dc3000000b0037061f5b19emr16542249ywb.316.1668510809441; Tue, 15 Nov 2022 03:13:29 -0800 (PST) MIME-Version: 1.0 References: <20221111113732.461881-1-thierry.reding@gmail.com> In-Reply-To: <20221111113732.461881-1-thierry.reding@gmail.com> From: Geert Uytterhoeven Date: Tue, 15 Nov 2022 12:13:17 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] gpiolib: of: Use correct fwnode for DT-probed chips To: Thierry Reding Cc: Bartosz Golaszewski , Linus Walleij , Andy Shevchenko , Dmitry Torokhov , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Marek Szyprowski , Linux-Renesas Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no 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 Hi Thierry, On Fri, Nov 11, 2022 at 12:40 PM Thierry Reding wrote: > From: Thierry Reding > > The OF node store in chip->fwnode is used to explicitly override the FW > node for a GPIO chip. For chips that use the default FW node (i.e. that > of their parent device), this will be NULL and cause the chip not to be > fully registered. > > Instead, use the GPIO device's FW node, which is set to either the node > of the parent device or the explicit override in chip->fwnode. > > Fixes: 8afe82550240 ("gpiolib: of: Prepare of_gpiochip_add() / of_gpiochip_remove() for fwnode") Thank you, I bisected boot failures on Renesas platforms to that commit, and then found your patch. > Tested-by: Marek Szyprowski > Signed-off-by: Thierry Reding Tested-by: Geert Uytterhoeven > --- > drivers/gpio/gpiolib-of.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c > index 4be3c21aa718..55c3712592db 100644 > --- a/drivers/gpio/gpiolib-of.c > +++ b/drivers/gpio/gpiolib-of.c > @@ -1067,7 +1067,7 @@ int of_gpiochip_add(struct gpio_chip *chip) > struct device_node *np; > int ret; > > - np = to_of_node(chip->fwnode); > + np = to_of_node(dev_fwnode(&chip->gpiodev->dev)); > if (!np) > return 0; > Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds