Received: by 2002:ac0:a679:0:0:0:0:0 with SMTP id p54csp489546imp; Wed, 20 Feb 2019 03:54:36 -0800 (PST) X-Google-Smtp-Source: AHgI3Ib4wwYiLqtqFKgW+++Ld+Sw+tQmuhAmHwIOI/uqlT3FbDgDac9KbMT6xZIeeZ8vkwf32/6B X-Received: by 2002:a62:1ac3:: with SMTP id a186mr3786156pfa.48.1550663676138; Wed, 20 Feb 2019 03:54:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550663676; cv=none; d=google.com; s=arc-20160816; b=LWdc3yzZ0X+Ov6bJuanywSDwZuTUTs8OKLp1u66p0wJSZ7p1nZgqQyM3b5O1IDkLxN +FMikaB1tVwtWpj/Jp+PRJMGAHIGM0nGaPlicpC0OAz2oQB+su24t+fWsb7ctSVkCMT+ rTjpxrb89R6L819MmAY/w+RlZDV1qiCHxBVedNWn29NDwsMouv/vlU1F7lBiesDE8RZF EZrI5ifhn1Ti2b6onTpOrtuHd68f1QFDm8WVyihYCSFlMu5pDh1o0nbyDrgO2mgaiNRc uJQYfRMdApHRPYwv+ZencrPIoQGvvgqIOnTH89Ws1+Y+zJty8n84ILHtkPT4nZ6boDHv adzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:message-id:in-reply-to:date:references:subject:cc:to :from; bh=YEEQDyMkj90APFOI/MYzyrBTUsPxQh1LrIByxcQRjBU=; b=CUvDdIb0iFeaxQCd1XQ0cjglFP4BT7AlsrNDeaCodjdUpcNiqgD4Jn+GZwZQ2B+tie /tEMzaHCYPz/R0EowJj0vl6g8CcPLY4LlDqOiOkNsu/0tI5UzzT9nHHjl0sPFWyF3fjj sKfpm2EEdEtU67LiFazwJKBtEd8G9Xc5jXtmtnmM4mTBMNo77Nj+3X76XyPG+ruamW22 laAjzjRBQdtg+W5KlNE4fYmLGqewL+g5sh2PspvNtU9FW0pnIktsQ6Tkv43n3sP8dP5B R6O8SMZLAuVs27XhVOWidfeaAI9CHtKWwFR1V4iPMr4SaSKocOtL2h1rdefMBsa+sSJT OT/A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 9si18087397pfq.129.2019.02.20.03.54.20; Wed, 20 Feb 2019 03:54:36 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726953AbfBTLxw convert rfc822-to-8bit (ORCPT + 99 others); Wed, 20 Feb 2019 06:53:52 -0500 Received: from unicorn.mansr.com ([81.2.72.234]:44704 "EHLO unicorn.mansr.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726197AbfBTLxw (ORCPT ); Wed, 20 Feb 2019 06:53:52 -0500 Received: by unicorn.mansr.com (Postfix, from userid 51770) id BB16015632; Wed, 20 Feb 2019 11:53:50 +0000 (GMT) From: =?iso-8859-1?Q?M=E5ns_Rullg=E5rd?= To: "Rafael J. Wysocki" Cc: Greg Kroah-Hartman , linux-kernel@vger.kernel.org Subject: Re: [PATCH] platform: set of_node in platform_device_register_full() References: <20190216164512.9525-1-mans@mansr.com> <20190220113506.11009-1-mans@mansr.com> Date: Wed, 20 Feb 2019 11:53:50 +0000 In-Reply-To: <20190220113506.11009-1-mans@mansr.com> (Mans Rullgard's message of "Wed, 20 Feb 2019 11:35:06 +0000") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Mans Rullgard writes: > If the provided fwnode is an OF node, set dev.of_node as well. > > Some drivers are just shims that create extra "glue" devices with the > DT device as parent and have the real driver bind to these. In these > cases, the glue device needs to get a reference to the original DT node > in order for the main driver to access properties and child nodes. > > For example, the sunxi-musb driver creates such a glue device using > platform_device_register_full(). Consequently, devices attached to > this USB interface don't get associated with DT nodes, if present, > the way they do with EHCI. > > This change will allow sunxi-musb and similar driver to easily > propagate the DT node to child devices as required. > > Signed-off-by: Mans Rullgard > --- > drivers/base/platform.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/base/platform.c b/drivers/base/platform.c > index dff82a3c2caa..853a1d0e5845 100644 > --- a/drivers/base/platform.c > +++ b/drivers/base/platform.c > @@ -512,6 +512,7 @@ struct platform_device *platform_device_register_full( > > pdev->dev.parent = pdevinfo->parent; > pdev->dev.fwnode = pdevinfo->fwnode; > + pdev->dev.of_node = of_node_get(to_of_node(pdev->dev.fwnode)); > > if (pdevinfo->dma_mask) { > /* > -- Sorry, I forgot to add a v2 to this. Anyway, the only change is the commit message. -- M?ns Rullg?rd