From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 44A2BC432C3 for ; Wed, 3 Mar 2021 18:52:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0AD6464EE1 for ; Wed, 3 Mar 2021 18:52:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1386307AbhCCSO3 (ORCPT ); Wed, 3 Mar 2021 13:14:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49912 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1384311AbhCCPmG (ORCPT ); Wed, 3 Mar 2021 10:42:06 -0500 Received: from ssl.serverraum.org (ssl.serverraum.org [IPv6:2a01:4f8:151:8464::1:2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F98DC061761; Wed, 3 Mar 2021 07:39:12 -0800 (PST) Received: from ssl.serverraum.org (web.serverraum.org [172.16.0.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ssl.serverraum.org (Postfix) with ESMTPSA id 48FAE2223A; Wed, 3 Mar 2021 16:39:08 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1614785948; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3tg9/2YH88B53ii3tFImN3rADlNo36/ozFOz8uqRXwI=; b=Fn6DrK1xAp2SF5XU/kuySfh9K2VMKZXKhSDOv1F+37YhnZ3Q4BzysP3D38yIgLC8O2K8m3 bHxFXdHSGVfPO7ApAhPQrexFuRrXwutwTEQl5G1iBDjbfVPmvrHo5UxOydWJsInUEJfixt sAz9wGwBZlgYQ9jvr8N+JDSoLyhDt6A= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Date: Wed, 03 Mar 2021 16:39:08 +0100 From: Michael Walle To: Linus Walleij Cc: =?UTF-8?Q?=C3=81lvaro_Fern=C3=A1ndez_Rojas?= , Rob Herring , Bartosz Golaszewski , Florian Fainelli , bcm-kernel-feedback-list , Jonas Gorski , Necip Fazil Yildiran , "open list:GPIO SUBSYSTEM" , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , linux-kernel@vger.kernel.org, Linux ARM Subject: Re: [PATCH v3 01/14] gpio: regmap: set gpio_chip of_node In-Reply-To: References: <20210303142310.6371-1-noltari@gmail.com> <20210303142310.6371-2-noltari@gmail.com> User-Agent: Roundcube Webmail/1.4.11 Message-ID: X-Sender: michael@walle.cc Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am 2021-03-03 16:27, schrieb Linus Walleij: > On Wed, Mar 3, 2021 at 3:23 PM Álvaro Fernández Rojas > wrote: > >> This is needed for properly registering gpio regmap as a child of a >> regmap >> pin controller. >> >> Signed-off-by: Álvaro Fernández Rojas >> --- >> v3: introduce patch needed for properly parsing gpio-ranges. > > Oops a little bug. I suggest that I merge this into the pinctrl tree > together with the rest of the patches when we are done with review. Ha, I've just debugged this because it puzzled me why it was working for me. I was about to suggesting using the following instead: chip->of_node = config->of_node ?: dev_of_node(config->parent); It turns out this is already done in of_gpio_dev_init(): https://elixir.bootlin.com/linux/v5.12-rc1/source/drivers/gpio/gpiolib-of.c#L1043 So config->of_node is still optional. But I'm not sure if we should add the line above for clarity in gpio-regmap.c. -michael