Received: by 2002:ac0:a679:0:0:0:0:0 with SMTP id p54csp381432imp; Wed, 20 Feb 2019 01:53:09 -0800 (PST) X-Google-Smtp-Source: AHgI3IYGcQHsHOOeHZOtRg7s2QpUsPo9up+d1fAOHhWHxvy7gS4KOTz6RFXavr41ZH4lCyP5NDqf X-Received: by 2002:a17:902:7202:: with SMTP id ba2mr35294643plb.147.1550656389007; Wed, 20 Feb 2019 01:53:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550656388; cv=none; d=google.com; s=arc-20160816; b=Fsq8BVIoXiVCkyDNtN0yHJb/qRMLb4kI755drQ2JBZZJ+h5Hy5/Y420L7V73TaLyL0 wIvM1G4MylXFps0QAumtWDiLk6tIcL0aFARylPWFUw0bexdGC3drbv5LqscXPuRFQSBK AxHsMrpKWne9YpKU6/YzGTYA9jgX/+zZCOltJ073VgAIWHSqzXxf6JW/YWlI9cCkx3JM KDsJ9ulAvRo5Ord+HmHg6Ac4dJrBC6YbUPNzpdM/JjCps6iSSye35usMiJ9MGCTP5zOl V4SMrGnyhuxsYneyAhKRUhaAHMgqNBcoMseBJ5I59vuUvMp/YSYUDDFp4jTpKhyrhS3r NDoQ== 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:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=qMLn/SI0fdTrnOFsZNp7TAHTWey9q9YoluT2z3wgTFs=; b=JJs1xc6cPRfobHJ7r0LBTM6j6dcBDAdVESBt8nNvo0ecTf2+r77RcMxHrnZfH6EuQF PKmjWIzZ0Ji32XibIJlOC2LMsKcPhIozn0m6yGAwwYcWjC7qvc4xdBpejBGWFKQEhGjw 1ICouszKUP/neDIVQllyMVC2T/+8RvMmNbs4KpCxM225OebWCioD4dpCW0cKw7Zy2yow GTE9vNftew4Lnokyj5Ks1FC00VGd5eOcBliEIxiGawDlkx1N/zbPODh70eE2IgvMzpnt Qw6Ts7vJ7Nbo2tyY/JIBrGz3ZFjAWTifXLi6gyC1lwmVghn+vY8y9q5PE54tnYkfBNcU BBWw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i39si19620261plb.256.2019.02.20.01.52.53; Wed, 20 Feb 2019 01:53:08 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727102AbfBTJuz convert rfc822-to-8bit (ORCPT + 99 others); Wed, 20 Feb 2019 04:50:55 -0500 Received: from mail-ot1-f67.google.com ([209.85.210.67]:34081 "EHLO mail-ot1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725816AbfBTJuz (ORCPT ); Wed, 20 Feb 2019 04:50:55 -0500 Received: by mail-ot1-f67.google.com with SMTP id 98so39259630oty.1 for ; Wed, 20 Feb 2019 01:50:55 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=x7ycj9SXZ5xf/DqvlVK9gKU0ZOhZzRzM/f8jp1kRiSo=; b=Xfp9mWG6Cj5EsiF7WebXSsYi8QtFo3j+EQieawgYnaNd+fm5GXe/DmWfGWKOM+0Nlt cwWMOJboIeLTJpWELg3XObsaC7Kq78smN9jk+izsuq862rXWWE3WJjvPiOjzWAzalOT1 NCC8LjqCaLWjTfYNBltGZV0aVimb00+R9oZ4k3s9zVqZ7Jl4AHMTiyqx8JibXT7J/I1Z SPRBscQfJRYZ7qZ97IXH6SA/V/90/SEO2h33vAi7OTBp4kqiCPhrki98SxmdH5EUmg7Q mca+4qO/feEAgsI4Gul76w9XJLJwur9anlQEBAVIChpB1sc3IzmWnC8cqclFywY7pDAF QSwA== X-Gm-Message-State: AHQUAuYec/QoT9W577sNOoPG1MKJcQ4ifCk22aA/7jWlYaR6Lkk7gDQU yrt1WkHURhSKJwT/Q7d05DDHdLGd1dk2BiNJK3E= X-Received: by 2002:aca:f4d3:: with SMTP id s202mr5351499oih.178.1550656254497; Wed, 20 Feb 2019 01:50:54 -0800 (PST) MIME-Version: 1.0 References: <20190216164512.9525-1-mans@mansr.com> In-Reply-To: From: "Rafael J. Wysocki" Date: Wed, 20 Feb 2019 10:50:43 +0100 Message-ID: Subject: Re: [PATCH] platform: set of_node in platform_device_register_full() To: =?UTF-8?B?TcOlbnMgUnVsbGfDpXJk?= Cc: "Rafael J. Wysocki" , Greg Kroah-Hartman , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 18, 2019 at 12:10 PM Måns Rullgård wrote: > > "Rafael J. Wysocki" writes: > > > On Sat, Feb 16, 2019 at 5:50 PM Mans Rullgard wrote: > >> > >> If the provided fwnode is an OF node, set dev.of_node as well. > >> > >> 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)); > > > > of_node_get() generally does a kobject_get() on the node's kobject, so > > when is that reference dropped? Or if it doesn't need to be dropped > > at all, why is this the case? > > platform_device_release() calls of_device_node_put(). Yes, it does, but this is the reference that's already acquired for devices added while parsing DT, isn't it? Your change adds an extra reference AFAICS. Also, why is this patch needed?