Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp379198rdb; Fri, 6 Oct 2023 06:24:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFUsKHUbnXl1H6IjYALV0ohTOudUGFbV8CwqP3M/Z0H9Bkg1HhGBLNHnFisMpxV401dt38F X-Received: by 2002:a17:90b:4b92:b0:26d:61:3aad with SMTP id lr18-20020a17090b4b9200b0026d00613aadmr7803565pjb.4.1696598672297; Fri, 06 Oct 2023 06:24:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696598672; cv=none; d=google.com; s=arc-20160816; b=SXQEhydH6qXdlOm3WUKdJcubHzcffO+qW18O8kaV0a52c3qfbRcB2R9wV3q7nUS+LT 4DbWS5XL9CHyaCgKwFSQwg6VoNnpUwRWGkhztpB9PJDkpU1jvtvFvXtMctA76JpyG/XO H5bLlXCxXtOjA72dKScmKP0m82STrEuhU2j5Vdl4RIizh6X5HXOMF0/mXdHBP7hqHFlY 3jCLDGk0J+8N3k1IhiGUBdsZ/obKj6NsFsC+m/Ja3zpgXiGQ3MhmOBmbQNYOkmrLJJ+6 Vz6p08QIupB/vjqdZZJ82c21U+PYGN8qkzazFLduXSX5kpIIb5Jj/eVikByIpy7nXBwQ F8fA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=kuY7CeANeMPlCOHuQvGM4GRutbwyxNygeedsxqIAxoM=; fh=8zzPHVF/p9r0cc6oSFRH8dycuoc95V92ffiysEQGGYk=; b=Vi1ILYk7wwdplQR9tU4mDRWqXhkueIOoNqQ8fyrJw4a69+TV6bS5LBooOSgNIS3Dsl dXF+fREIsuUl4eqK0eOQlykqbf8uENrn4HPnb5fM+3C9ifaJjEH+kHtGUv1uvlz+q2y7 BOoVH/2AzSMgMBT4csRRUdpJ21KskN3z9V5smZJycBeDIFTVHgVFBla40jOlfi40Ak96 32IYsjRJ3msKwYJtbf0kZbnYhJBGwzJV5f9F1rBLQhRHnUUjuNfIJ4tQ2uewX5pJuMwY F8CBVZBxzTNGyGUqwV27p8vUUBTwcrZe6Lm25alwB/HW4ygPN73WsyF2wTDfNNuWQxnT zL4A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id w11-20020a17090abc0b00b00278f79e4fabsi5795011pjr.93.2023.10.06.06.24.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Oct 2023 06:24:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 0B74B80A53C5; Fri, 6 Oct 2023 06:24:30 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232425AbjJFNYM (ORCPT + 99 others); Fri, 6 Oct 2023 09:24:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49120 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232342AbjJFNYK (ORCPT ); Fri, 6 Oct 2023 09:24:10 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E7E9E83; Fri, 6 Oct 2023 06:24:09 -0700 (PDT) X-IronPort-AV: E=McAfee;i="6600,9927,10855"; a="447936054" X-IronPort-AV: E=Sophos;i="6.03,204,1694761200"; d="scan'208";a="447936054" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Oct 2023 06:24:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10855"; a="868346711" X-IronPort-AV: E=Sophos;i="6.03,204,1694761200"; d="scan'208";a="868346711" Received: from smile.fi.intel.com ([10.237.72.54]) by fmsmga002.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Oct 2023 06:24:07 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.97-RC1) (envelope-from ) id 1qokoG-00000003J0e-2juc; Fri, 06 Oct 2023 16:24:04 +0300 Date: Fri, 6 Oct 2023 16:24:04 +0300 From: Andy Shevchenko To: Bartosz Golaszewski Cc: Linus Walleij , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Dipen Patel , Bartosz Golaszewski Subject: Re: [RFC/RFT PATCH] gpiolib: reverse-assign the fwnode to struct gpio_chip Message-ID: References: <20231006115147.18559-1-brgl@bgdev.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231006115147.18559-1-brgl@bgdev.pl> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Spam-Status: No, score=2.6 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,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 morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Fri, 06 Oct 2023 06:24:30 -0700 (PDT) X-Spam-Level: ** On Fri, Oct 06, 2023 at 01:51:47PM +0200, Bartosz Golaszewski wrote: > From: Bartosz Golaszewski > > struct gpio_chip is not only used to carry the information needed to > set-up a GPIO device but is also used in all GPIOLIB callbacks and is > passed to the matching functions of lookup helpers. > > In that last case, it is currently impossible to match a GPIO device by > fwnode unless it was explicitly assigned to the chip in the provider > code. If the fwnode is taken from the parent device, the pointer in > struct gpio_chip will remain NULL. > > If we have a parent device but gc->fwnode was not assigned by the > provider, let's assign it ourselves so that lookup by fwnode can work in > all cases. ... > + gc->fwnode = parent_fwnode; Ah, this is basically reverts my commit, the whole idea of which was to go towards constant struct gpio_chip object that is supplied by a provider. -- With Best Regards, Andy Shevchenko