Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1384312pxb; Thu, 4 Mar 2021 09:56:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJyi3+aqeNdxX4RUA6A7u1PMgFBebBKrYeMxy2xTy3dnsCBcAZfC0SruqozHhHk2NQ3S+NB8 X-Received: by 2002:a50:9d8a:: with SMTP id w10mr5680047ede.39.1614880606140; Thu, 04 Mar 2021 09:56:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614880606; cv=none; d=google.com; s=arc-20160816; b=HeNCiP6FQZqf4O+aRTcQhvPtYLbwbQrq1oK9kx8/+3twxI6azIcApamAwVjCQb56gQ WEO6uVoa5509ADIj4X8eFneMlcNd8hRSd6a3SrP78YT+RM0AICef4Ezlc0apesZ9v7gj hymk6qLPggwg8N8+G5gsY5BPxJzBYNwY+NLQ2dfcyFt3xdz6y+28OeSsjD4mD5thzFen k6/pz6vG3doxJxXf1Ed2Mc7t43n2FMuFy2+0cQ+DE75Fu7g4VoJ8qnQcRq/eu0abpA6i IruOe8UhT94aVYTy35xnOPpmDHtmDgiI0lUwIPpYLLfx/uF2C04mm+P345t+TaGs1Lfe s18w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:user-agent:references:in-reply-to :subject:cc:to:from:date:content-transfer-encoding:mime-version :dkim-signature; bh=DA30murhEvgKpAf+gX5S/ctkqDo3ACRWN/3NimWCRKk=; b=sxyaM2ImtdxbFM3OgUOazLAV1bFOz2lapnJbeWStX80y+TlGXgN7/DOQjDgDIb1grB y+BuFmzP6H8jSwOGCetYkiseA/gFs/fEMNp4o/LcyafJXThi8mVUcEyYIIEpuPXiR0p2 PTq54bGuERhPcZ1aqJB3bfIHkPy1+4Y7CV0LtRitI/S3/4MrxS2xW7t413p91eOBohvJ wNrJlhqEeYDKzYTKXJQcnRLesJfyORlKhj7NhuYvswHtYRLACLSpUbocwYc5ZkxKoXVB RhnrAjtadu7XM2fyDzB1B2NZWtp2VvSRwg9Mg4VrUH0LQ/3XqB4wqIOmcmyd/AzUorxe K/Pg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b=hXXJHypQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l17si18852838ejx.485.2021.03.04.09.56.22; Thu, 04 Mar 2021 09:56:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b=hXXJHypQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234936AbhCDPcF (ORCPT + 99 others); Thu, 4 Mar 2021 10:32:05 -0500 Received: from ssl.serverraum.org ([176.9.125.105]:58297 "EHLO ssl.serverraum.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234913AbhCDPcC (ORCPT ); Thu, 4 Mar 2021 10:32:02 -0500 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 306F822234; Thu, 4 Mar 2021 16:31:20 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1614871880; 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=DA30murhEvgKpAf+gX5S/ctkqDo3ACRWN/3NimWCRKk=; b=hXXJHypQ4ojCx17slQ/Qf+ED9+PcbAhcz3rt1c8l/U7N1ONSuf9iRqgpzoNFCkqz+ayjHh dbxmUiJew4zIa1w3FVpIqu4O+Ysb7wWaA9WM1ZkYRNTFEVBB7Zk9a3eqNNP4GWqb7U2UFz uO/4YP4adt8M2Hx3wDSbA4kNd5hVnHc= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Date: Thu, 04 Mar 2021 16:31:20 +0100 From: Michael Walle To: Andy Shevchenko Cc: =?UTF-8?Q?=C3=81lvaro_Fern=C3=A1ndez_Rojas?= , Linus Walleij , Bartosz Golaszewski , "open list:GPIO SUBSYSTEM" , Linux Kernel Mailing List Subject: Re: [PATCH v2] gpio: regmap: set gpio_chip of_node In-Reply-To: References: <20210304071506.18434-1-noltari@gmail.com> User-Agent: Roundcube Webmail/1.4.11 Message-ID: <7b12985726c898d63d882486f01a60d7@walle.cc> X-Sender: michael@walle.cc Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am 2021-03-04 16:22, schrieb Andy Shevchenko: > On Thu, Mar 4, 2021 at 5:18 PM Álvaro Fernández Rojas > wrote: >> >> This is needed for properly registering gpio regmap as a child of a >> regmap >> pin controller. > >> + chip->of_node = config->of_node ?: >> dev_of_node(config->parent); > > After a closer look I have no clue why you need this patch at all. > The second part, i.e. assigning parent's fwnode, is done already in > the GPIO library core. > The first part, keeping fwnode in the regmap configuration puzzles me. > Why? You're right if chip->of_node is not set it will eventually be set to node of the parent device. In case of the BCM driver the parent device is the pinctrl device and the node is a children (if that is correct I cannot say). So, in this case you cannot use the node of the parent, because that would be the pinctrl one. You could just use chip->of_node = dev_of_node(config->parent) But then it is not obvious that it is optional. Hence my suggestion to explicitly set to the parent of_node if none is supplied. -michael