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 894B6C54EAA for ; Fri, 27 Jan 2023 09:27:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232952AbjA0J15 (ORCPT ); Fri, 27 Jan 2023 04:27:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42308 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232735AbjA0J1y (ORCPT ); Fri, 27 Jan 2023 04:27:54 -0500 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9AA055BA9; Fri, 27 Jan 2023 01:27:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1674811672; x=1706347672; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=irOFwGOpCdgiAWhOEXeba39LtNKCJ17Fddk8cCsao5I=; b=EQ/tr08Otk1Dg0J1e5sOT5KRZv58/hHcvAdP09KJ8VUI0ecXQX5TdB2f qL/Vyuvf7gDXjtqg9Qw4V03i2+k3R/4pH8UsTr64XF/ndNQdaOibnZm5F ViTVEg7qn5fi7GCgShmH2T7ihnzznMp+QI0QDKH+EdhNq7lrmwN6TucgE C0vIxknLYew1D0v9UdW/iJCt9m2AqKnYol0rEEYob0faFfps6M/lqJLPp FwgOJaSwQBfV3NVTbLrwSsxuBuIhCHBpblitBLW0DcI6MLpsyYat+WhUO e0QVDxnjuccNclxpE3GWTOZu1HKFAgaGNBc+JkhNxdrELsbOKq1fsK49e g==; X-IronPort-AV: E=McAfee;i="6500,9779,10602"; a="325723982" X-IronPort-AV: E=Sophos;i="5.97,250,1669104000"; d="scan'208";a="325723982" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Jan 2023 01:27:23 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10602"; a="787159567" X-IronPort-AV: E=Sophos;i="5.97,250,1669104000"; d="scan'208";a="787159567" Received: from smile.fi.intel.com ([10.237.72.54]) by orsmga004.jf.intel.com with ESMTP; 27 Jan 2023 01:27:10 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1pLL0k-00FtTe-1I; Fri, 27 Jan 2023 11:27:06 +0200 Date: Fri, 27 Jan 2023 11:27:06 +0200 From: Andy Shevchenko To: Saravana Kannan Cc: Greg Kroah-Hartman , "Rafael J. Wysocki" , Sudeep Holla , Cristian Marussi , Linus Walleij , Bartosz Golaszewski , Thomas Gleixner , Marc Zyngier , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Rob Herring , Frank Rowand , Geert Uytterhoeven , Magnus Damm , Len Brown , Daniel Scally , Heikki Krogerus , Sakari Ailus , Tony Lindgren , Linux Kernel Functional Testing , Naresh Kamboju , Abel Vesa , Alexander Stein , Geert Uytterhoeven , John Stultz , Doug Anderson , Guenter Roeck , Dmitry Baryshkov , Maxim Kiselev , Maxim Kochetkov , Miquel Raynal , Luca Weiss , Colin Foster , Martin Kepplinger , Jean-Philippe Brucker , kernel-team@android.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-acpi@vger.kernel.org Subject: Re: [PATCH v2 04/11] gpiolib: Clear the gpio_device's fwnode initialized flag before adding Message-ID: References: <20230127001141.407071-1-saravanak@google.com> <20230127001141.407071-5-saravanak@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230127001141.407071-5-saravanak@google.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 26, 2023 at 04:11:31PM -0800, Saravana Kannan wrote: > 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. ... > + /* > + * 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); Do not dereference fwnode in struct device. Use dev_fwnode() for that. struct fwnode_handle *fwnode = dev_fwnode(&gdev->dev); if (!fwnode->dev) fwnode_dev_initialized(fwnode, false); + Blank line. > ret = gcdev_register(gdev, gpio_devt); > if (ret) > return ret; -- With Best Regards, Andy Shevchenko