Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp214497rdg; Tue, 10 Oct 2023 08:18:25 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFkjzCS50vqKCKQRA3RWMMGuqTAwYXYtCpr91lqq56Qt9vYr2RlRmIim0dHbwPtEw87FmP3 X-Received: by 2002:a17:90b:23d8:b0:267:fba3:ed96 with SMTP id md24-20020a17090b23d800b00267fba3ed96mr14281261pjb.3.1696951105291; Tue, 10 Oct 2023 08:18:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696951105; cv=none; d=google.com; s=arc-20160816; b=a4ZvCa2a3ybJ4AihF1F3PdLHejF1DWubQJVgwpoo/YLdFaCu6UV8BvJd0A4S9c3awS nVShs2NaJlojnIhfWeBpoxcIufCw5LEgopTDIYT2DTJb5oVsQLE8Q0WYPErLTjN0V2N1 GfA3eNDN3GAhHRVLYsS1GiCwRvHFAvnKDvsQSCsQ6wIZxqzz8qO/jRBMV9lS+H8TE772 rkU8GZEr9caul+Iz3iVQKz7MzKS9o2z/GuIfaxQmyy0tObbsrmSKDsv/bhyIqFXNTWeH +oZdku591U67V5tdpBkJRHAewvYD9HL1t7IJQrBrDJ8dYN/eYfX/lk/8GzYN9h+PaxiM SqDw== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=DUaDCg9+5Td4JurICAZ0j/zmddFFk9WphgYv/mB8ZEQ=; fh=vdGafQsUDgioI++VRLb5u16CwR/8WqvCry/fKIbeWBo=; b=oFtPv5spTR0rix5t3fQPwd0rr2Kx9eHcUQcbgNGrvzb0fDgZ382SHO9uOBgE2458fT Znhl4sRh/go/Tsvie7Ldak2DE2POOb6j0/4iXUdYYq4t/gXk49VJDS2l4IoOLzuRCj3D tW2pYs0T3hFc1ZOD7fEd9u4e7qWVhBrpAlz3Gs6RCMUDwlgh5b6zKfvRUk38zC8WTu/4 aYNh7kuywGwC8GTJCwpck1bR667NQ4F9TnCGKk3PoYh80b1c8/ftEpS1+ovimJ/KipaY NA8/UGzPc1bn9sPli7pWTuAtGlCrpGjz9WbstLxyZur4gR+rrMV5h1yMMTlvrHYJO1vc 0YQA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id mu10-20020a17090b388a00b0027762d9999csi13045429pjb.155.2023.10.10.08.18.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 08:18:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (Postfix) with ESMTP id 033D98167DA1; Tue, 10 Oct 2023 08:18:23 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232771AbjJJPSP (ORCPT + 99 others); Tue, 10 Oct 2023 11:18:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53364 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231578AbjJJPSN (ORCPT ); Tue, 10 Oct 2023 11:18:13 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F428AC; Tue, 10 Oct 2023 08:18:11 -0700 (PDT) X-IronPort-AV: E=McAfee;i="6600,9927,10859"; a="363771718" X-IronPort-AV: E=Sophos;i="6.03,213,1694761200"; d="scan'208";a="363771718" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Oct 2023 08:18:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10859"; a="823812908" X-IronPort-AV: E=Sophos;i="6.03,213,1694761200"; d="scan'208";a="823812908" Received: from smile.fi.intel.com ([10.237.72.54]) by fmsmga004.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Oct 2023 08:18:09 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.97-RC1) (envelope-from ) id 1qqEUn-00000004NJZ-3tXk; Tue, 10 Oct 2023 18:18:05 +0300 Date: Tue, 10 Oct 2023 18:18:05 +0300 From: Andy Shevchenko To: Bartosz Golaszewski Cc: Dipen Patel , linus.walleij@linaro.org, thierry.reding@gmail.com, jonathanh@nvidia.com, linux-gpio@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/1] gpio: tegra186: Set fwnode of the GPIO chip Message-ID: References: <20231009173858.723686-1-dipenp@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: 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 lipwig.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 (lipwig.vger.email [0.0.0.0]); Tue, 10 Oct 2023 08:18:23 -0700 (PDT) X-Spam-Level: ** On Tue, Oct 10, 2023 at 05:10:08PM +0200, Bartosz Golaszewski wrote: > On Tue, Oct 10, 2023 at 4:25 PM Andy Shevchenko wrote: > > On Tue, Oct 10, 2023 at 05:13:42PM +0300, Andy Shevchenko wrote: > > > On Tue, Oct 10, 2023 at 04:48:25PM +0300, Andy Shevchenko wrote: > > > > On Tue, Oct 10, 2023 at 04:13:19PM +0300, Andy Shevchenko wrote: > > > > > On Mon, Oct 09, 2023 at 10:38:58AM -0700, Dipen Patel wrote: ... > > > > > > + /* > > > > > > + * This is needed for driver using gpio device matching where it > > > > > > + * has to use gpio_chip fwnode to match the gpio controller. > > > > > > + */ > > > > > > + gpio->gpio.fwnode = of_node_to_fwnode(pdev->dev.of_node); > > > > > > > > > > of_node_to_fwnode() is specific to IRQ, in other places we use generic > > > > > of_fwnode_handle(). That's why better just to use dev_fwnode(). > > > > > > > > On the second thought is there any parent assigned? > > > > At least I see that in tegra186_gpio_probe(). Are you saying > > > > it is not working? Or is it (matching) called _before_ we > > > > add a GPIO device? > > > > > > Okay, I think I got it. There is a function called tegra_gpiochip_match() > > > in drivers/hte/hte-tegra194.c which fails after my patch. Yeah, if provider > > > doesn't set fwnode, it can't match. But, since the driver sets the parent > > > properly it means that the matching function should be done against the > > > device. > > > > > > Seems to me that in HTE code the matching function is broken. > > > > I'll send a patch soon. Please, test it. > > I'll have you know that if it is about to add any new "#include > ../gpio/gpiolib.h", then it's a preemptive NAK from me. :) Nope, see I just sent it. -- With Best Regards, Andy Shevchenko