Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp4673186ybl; Mon, 26 Aug 2019 14:09:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqy2YouAz7eX4KT6CVSrYOFUq+76Y0vJNwBu38yca5DYCztMB7Hs0L/F4F5T1zWzyPunsxTJ X-Received: by 2002:a17:90a:b00a:: with SMTP id x10mr22628123pjq.113.1566853749187; Mon, 26 Aug 2019 14:09:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566853749; cv=none; d=google.com; s=arc-20160816; b=SADwyJO1lRHwTXuQslbskZbw2zkpubbjA5RhTdYZgNHBfzHxChJfsPgHi8loYFGptI H372GjXJb+Zwi3IWOKWhswPYP8hsXnyrhnyGqUR090u3n93FHN9D47erv3SdK09Tk4d+ grrs/YTkBT4LNHexC0y1I7l7KJC+kOLa07pWn43OWTa8eY4rw2rStgQtvxRS64zsnbMt aUZ3eyJ8+8pfEos9vArTWIspuAr8D+uCuaSyjHelQ1W/ek3AVV96i/JnR+6nncYkk4jq 96a6sFpUSll6Ikito1N0gF6bRAUZi82yLYgQXcS6M4OlBYGNrYBIcSSsEvcVY/SwSb7b NlpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:user-agent:from:to:subject:cc :references:in-reply-to:content-transfer-encoding:mime-version :message-id:dkim-signature; bh=FghN6Mc40EPJyH60IJRS3NSuxjYJJ6oJa+6cfkHbcEQ=; b=TgGLwrAtL9HCylDzvKD0YJulLrhulrbrDwFWns9ANAhguJ2B6ans3Xxei/TkSalhWQ lP+WPPQMhHRPG0MHIT1hw4kRA9Tfv+vtJ7dFhSK27aGesMkl0ai3NmgkSCV1SfdJG4Ds cOhYvHHq8RGNZ6do/jQE1tyD8vqTOFbw224cG6wyMI6HLTPM6jpRXcpxY9GZjn6avPFQ TNc869l9luPcnGUOHDfjB0yeSdENQ4wpav94dDT6XDxMMX71sgDhB9LTCe8SWrSm/5O+ 413antyH0D9IoZnwsXWtGPZbsQZX//0D/vbSbwe1+2IxQoxmRiLIW+oFHVCjBA4PEppu 3MeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=CG3B73Jc; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f8si10365569pgb.566.2019.08.26.14.08.46; Mon, 26 Aug 2019 14:09:09 -0700 (PDT) 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; dkim=pass header.i=@chromium.org header.s=google header.b=CG3B73Jc; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727086AbfHZUz6 (ORCPT + 99 others); Mon, 26 Aug 2019 16:55:58 -0400 Received: from mail-pl1-f195.google.com ([209.85.214.195]:43966 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725983AbfHZUzx (ORCPT ); Mon, 26 Aug 2019 16:55:53 -0400 Received: by mail-pl1-f195.google.com with SMTP id 4so10607414pld.10 for ; Mon, 26 Aug 2019 13:55:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=message-id:mime-version:content-transfer-encoding:in-reply-to :references:cc:subject:to:from:user-agent:date; bh=FghN6Mc40EPJyH60IJRS3NSuxjYJJ6oJa+6cfkHbcEQ=; b=CG3B73JctUodMjIEjMsdzkgftz3Lk7Hw301lt+ChJplNaD4WWljA7Mf07AXYJSksH1 zK8iBXNS71J22cYdDCipqCOVcu10jmcRPqdcB4jWsfUDB3moMUaJLamzkZumWqO4cAbv x9nBWiUT7BbCgCsl6xfUyRcRXV8tN/eRY/9eo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:mime-version :content-transfer-encoding:in-reply-to:references:cc:subject:to:from :user-agent:date; bh=FghN6Mc40EPJyH60IJRS3NSuxjYJJ6oJa+6cfkHbcEQ=; b=Os87Xp7aMQsbttrxc5ZdT2I2SkYt8verJ50jfoh4m0c0vmx1sxiuFRIBIWaRVOJOkk YBTQYZ7EOk7fZwAXqzXpsYW6HpH+KFYX/khatahQ5+Vj18C1be3nqtWCcY2aBKRCQdRU sjDu9dz3aTAx7ke1i15ROqJ2eUCx31rM2wYESNvyVIq2ilWJ5wUgxnPQ9jDzbhhgDdGz lMdtEEjtUn5MkERIjciR+l2mFXPih7FtFyFpfpMnrBkg3WYbs7WkBBAtUZiusMR9C7Ka O2//hZ0qZfbVbY7K0RDUCba2dySZVcto/v7UgCjJY+h0dj4hd9yFF5RqlkzK9wjo7S1z ECQg== X-Gm-Message-State: APjAAAUpdURop9OkeHN5VBG3qLZDGZN/uAMfo5040SY/p9kAzYrfFevq K2NaH9oBFDKupWM5t3HQcMNBPA== X-Received: by 2002:a17:902:a40d:: with SMTP id p13mr20580372plq.92.1566852953013; Mon, 26 Aug 2019 13:55:53 -0700 (PDT) Received: from chromium.org ([2620:15c:202:1:fa53:7765:582b:82b9]) by smtp.gmail.com with ESMTPSA id v184sm11039530pgd.34.2019.08.26.13.55.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Aug 2019 13:55:52 -0700 (PDT) Message-ID: <5d644758.1c69fb81.76a4f.cf59@mx.google.com> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: References: <534b5017c2210ba8d541c206dace204d6617b4c9.1564091601.git.amit.kucheria@linaro.org> <5d577d77.1c69fb81.b6b07.83e6@mx.google.com> <5d5ab1e0.1c69fb81.d71db.1ca3@mx.google.com> Cc: Andy Gross , Daniel Lezcano , Mark Rutland , Rob Herring , Zhang Rui , Andy Gross , Bjorn Andersson , Eduardo Valentin , linux-arm-msm , LKML , Linux PM list Subject: Re: [PATCH 04/15] drivers: thermal: tsens: Add debugfs support To: Amit Kucheria From: Stephen Boyd User-Agent: alot/0.8.1 Date: Mon, 26 Aug 2019 13:55:51 -0700 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Amit Kucheria (2019-08-21 05:55:39) > On Mon, Aug 19, 2019 at 7:57 PM Stephen Boyd wrote: > > > > Quoting Amit Kucheria (2019-08-19 00:58:23) > > > On Sat, Aug 17, 2019 at 9:37 AM Stephen Boyd wr= ote: > > > > > + > > > > > +static void tsens_debug_init(struct platform_device *pdev) > > > > > +{ > > > > > + struct tsens_priv *priv =3D platform_get_drvdata(pdev); > > > > > + struct dentry *root, *file; > > > > > + > > > > > + root =3D debugfs_lookup("tsens", NULL); > > > > > > > > Does this get created many times? Why doesn't tsens have a pointer = to > > > > the root saved away somewhere globally? > > > > > > > > > > I guess we could call the statement below to create the root dir and > > > save away the pointer. I was trying to avoid #ifdef CONFIG_DEBUG_FS in > > > init_common() and instead have all of it in a single function that > > > gets called once per instance of the tsens controller. > > > > Or call this code many times and try to create the tsens node if > > !tsens_root exists where the variable is some global. >=20 > So I didn't quite understand this statement. The change you're > requesting is that the 'root' variable below should be a global? >=20 > tsens_probe() will get called twice on platforms with two instances of > the controller. So I will need to check some place if the 'tsens' root > dir already exists in debugfs, no? That is what I'm doing below. >=20 Yeah. I was suggesting making a global instead of doing the lookup, but I guess the lookup is fine and avoids a global variable. It's all debugfs so it doesn't really matter. Sorry! Do whatever then.