Received: by 2002:a05:6358:e9c4:b0:b2:91dc:71ab with SMTP id hc4csp6738662rwb; Tue, 9 Aug 2022 23:34:24 -0700 (PDT) X-Google-Smtp-Source: AA6agR6fgG8+LCQVH1HcHBpQzQBXR9GVhoEFjM+j6k7rty6dwzwS8cQWqXTQYrkKgSn0FRLcLyUS X-Received: by 2002:a17:902:9005:b0:16d:296b:6272 with SMTP id a5-20020a170902900500b0016d296b6272mr26297553plp.144.1660113264287; Tue, 09 Aug 2022 23:34:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660113264; cv=none; d=google.com; s=arc-20160816; b=uC1ynuZS3WErKMEK1PX/zCoT9fGhN9ZhjM60tOFO/x/qk9Fqcg3i8VfZiH6BFQr10A V9nkqYvvLTuzQCo2WQJsr5Zdet9/D1AzQc9JSUbyQBh0ZQxwwurPUWQ/iavbG65MqBJQ HRSJkpg+kJ0rCgtJmMV9upH9+qJj06MmWGpCJYYz7PUeELjhuXZ8QmFuWbuuXMmcTJL0 jwQowYqPwl7c29evc6lctNwjyJhN/UJ/lee4QIgmcyPQ6OAk+T+u8qsC+isBJaq02IKX VI6g/ypc8ioBKGGJM9JuEtkJeWsxSjkGyswqyMSmcyu1bpKgHN6qfNEt/Z2ga4XgH8j4 Sq0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:references:mime-version :message-id:in-reply-to:date:dkim-signature; bh=NqpNj2ocNlieJvtq2Rsc6gGxelmaBpd53cWZI4hRdYA=; b=KKQfBaf9NzI4otKrTuVgY25aD36cdIp5YMSzYAqaHYOmdmIC+fI9+7H5a/qy554zmN FbVUoHvPdUt22KfEe4IjEiOWWrZD3kkR23HPnMIVfBIHXlKDpPYI+0tLAVIS7cQ6CiyU 6O5ztY9JPO/nLWogtCRRKfg2ty6Snc+1KZhRJK1HBPkjAYEeu4va6X1GadplelcRBncY 8sJzwqAAHrMlrgNTye+LnpQUXWUdc3Sw6KkFcl3M6j18TlrT56G3sm8Kw++3iLQtJ/IX yDjMxQGHLPLBn8RRYgQ3xEQzGPF32EutVOk3GlkYN7JlVFw43V+KBXPZ5V3W+oUOH9jD BZ8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=MzzjYm5H; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t8-20020a63f348000000b0041c11497138si465437pgj.788.2022.08.09.23.34.11; Tue, 09 Aug 2022 23:34:24 -0700 (PDT) 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=@google.com header.s=20210112 header.b=MzzjYm5H; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231225AbiHJGBi (ORCPT + 99 others); Wed, 10 Aug 2022 02:01:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59992 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231186AbiHJGBA (ORCPT ); Wed, 10 Aug 2022 02:01:00 -0400 Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 139D91ADA6 for ; Tue, 9 Aug 2022 23:00:59 -0700 (PDT) Received: by mail-yb1-xb4a.google.com with SMTP id x19-20020a25e013000000b0067c0cedc96bso4612356ybg.21 for ; Tue, 09 Aug 2022 23:00:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:references:mime-version:message-id:in-reply-to :date:from:to:cc; bh=NqpNj2ocNlieJvtq2Rsc6gGxelmaBpd53cWZI4hRdYA=; b=MzzjYm5HiDy/e+AAiaA8O6qiqZTeuWaSmUul6mrOTOGDjmtqabFjSlUNlBvvqWqvOu jF8wpL3gD98q8iaJmJbPNXu5Jcq8MaF5znAghQHPSyfDKTPcRmFjFafFYiQiT0r/WTpG +pdffSn/lWfXQ2MYHZ1u8WuOaTCyJmQBiBsejjHkXUCYJVGFcgsxP6qjdh6pQLU4RxSh MxKKjJC87FeBV3cirBR0UWIGiLTcZlyT5xuhr0DEtPacLRS5oC3vA1APF7Rb9kLp3z3n pFISfY34zzCPsGmOLdR3XFq8QeDaH/onImXVvKiUASr7k3HuVan3sxyNgwF3q+8F4/HV B+2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:references:mime-version:message-id:in-reply-to :date:x-gm-message-state:from:to:cc; bh=NqpNj2ocNlieJvtq2Rsc6gGxelmaBpd53cWZI4hRdYA=; b=5u3TWuOYikyZxJNikBCYp9eTNLNWfSb0iywcnIGfWoBrrj0qGIY+6QoZSS42IJck75 P0sYEPfY+5UEqUuWsBMpxS/IC/2YUse3vn66f6WPYlWM152Vhr6jv1rtQwec5sOu0FVq zst/sk407bkHnGC2UImdybESiZnG4wFXaebN+YJGgJWo+WBusUObHwnuk23kEgXJ1A1B NbiUSyuKeOS7acMeQrCI7BtJuRBQqdO/7SbK13KdAwAWnVCKoQ79BTXgSHGfDkSQeIGe ++SVa+6wMul9TZXFSA5Hg/o4h8dXntgIcy20k15M/ZxwXFjevpBkuq+VpMcvW/yoO5RB pHNQ== X-Gm-Message-State: ACgBeo0NsZAQjHnANdUYXwm6A+oH4g+H9cbVjP5Peqs18HjFcFDPZTYB cWDyMT9UwZgwvfv7RV/VltPKdR11NSMJ7s0= X-Received: from saravanak.san.corp.google.com ([2620:15c:2d:3:f21:76ca:766f:e0ab]) (user=saravanak job=sendgmr) by 2002:a25:b9c3:0:b0:668:a418:13c with SMTP id y3-20020a25b9c3000000b00668a418013cmr22880523ybj.498.1660111258798; Tue, 09 Aug 2022 23:00:58 -0700 (PDT) Date: Tue, 9 Aug 2022 23:00:33 -0700 In-Reply-To: <20220810060040.321697-1-saravanak@google.com> Message-Id: <20220810060040.321697-5-saravanak@google.com> Mime-Version: 1.0 References: <20220810060040.321697-1-saravanak@google.com> X-Mailer: git-send-email 2.37.1.559.g78731f0fdb-goog Subject: [PATCH v1 4/9] gpiolib: Clear the gpio_device's fwnode initialized flag before adding From: Saravana Kannan To: Greg Kroah-Hartman , "Rafael J. Wysocki" , Linus Walleij , Bartosz Golaszewski , Rob Herring , Frank Rowand , Geert Uytterhoeven , Magnus Damm , Andy Shevchenko , Daniel Scally , Heikki Krogerus , Sakari Ailus , Len Brown Cc: Saravana Kannan , Abel Vesa , Alexander Stein , Tony Lindgren , Sudeep Holla , Geert Uytterhoeven , John Stultz , Doug Anderson , Guenter Roeck , kernel-team@android.com, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-acpi@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL autolearn=unavailable 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 Registering an irqdomain sets the flag for the fwnode. But having the flag set when a device is added is interpreted by fw_devlink to mean the device has already been initialized and will never probe. This prevents fw_devlink from creating device links with the gpio_device as a supplier. So, clear the flag before adding the device. Signed-off-by: Saravana Kannan --- drivers/gpio/gpiolib.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index cc9c0a12259e..1d57d6f24632 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c @@ -522,6 +522,12 @@ static int gpiochip_setup_dev(struct gpio_device *gdev) { int ret; + /* + * If fwnode doesn't belong to another device, it's safe to clear its + * initialized flag. + */ + if (!gdev->dev.fwnode->dev) + fwnode_dev_initialized(gdev->dev.fwnode, false); ret = gcdev_register(gdev, gpio_devt); if (ret) return ret; -- 2.37.1.559.g78731f0fdb-goog