Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp806156ybl; Wed, 21 Aug 2019 05:58:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqzduj/DqDIVvSQMqRLAHCG3EkdgDEJ1Q2sI1U8PIKDhHK4X+/scjJlYOuQbOhWDI9TYwQLo X-Received: by 2002:a63:2887:: with SMTP id o129mr28536580pgo.179.1566392303239; Wed, 21 Aug 2019 05:58:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566392303; cv=none; d=google.com; s=arc-20160816; b=aQr+hyAwRb4gBvEIXPP7w9PzGTqzQ+AZkzjh8Lv5u0qVJm1ZAoJ3S6FMxSNhj2tL/U Q/AmqO0U69JNJ00JQ7zTjJiwQnvexnetS9mScNhkTU7zhlNpAfHpytXxiLRiw2UyAQX9 b6nVOC88Vl+nbk2427xMhkcP53Hz39ZzFE83V8UR7X6ZjvCoE2ez9AqICFgtgD40ZbiR JayJ0wUGxHAPCPkQa+54xo4o//mou1bO2S3dTyWN+LGmZKn791QMweOvUOxlUagIK2ez vy3xFArKiktzoJoSMZOsEDOvjeuKXpmdahiR1sdeyjOCT/yTHuxzQaJCh8I+TfIfY+Us baZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=Im1BQWra9a4owWUT8RgHgoF9dvQvnpJmlT3+mhtCgoE=; b=nE4hu/xI0A6o/RmxgmD4Nxcch2Jx79aSW8rLt+dYn8BzH4b359c36Xld5nofdpt/Du cwIrHAO5JI9wW6uvkzNr2QEGOe5csp4XMlTsbk7ZRJvoMh27UAZjFGyV+ghaRaIsWiCX NhCa0q1X4/jz1PItbIO+p3xH199PO2GRzKyZDdFWFuyzKpFgI74mFmW7+keC+N4vj3hp mEi+DNHjBTA9zjQIV0wfBjVcbyQb/C9ID2z6NIHhESfwlypmXhGl+E8di3Ar2+BuAfmf LRcYF6PPFWUl/T1i/AdsmHeY3Revf3vx1VW4fkDv6D0Zwebb1t8sEKQqY8sUTO4gnQlJ WGnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UPB2yYVq; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y1si14293917pgg.490.2019.08.21.05.58.08; Wed, 21 Aug 2019 05:58:23 -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=@linaro.org header.s=google header.b=UPB2yYVq; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728638AbfHUMzx (ORCPT + 99 others); Wed, 21 Aug 2019 08:55:53 -0400 Received: from mail-qk1-f193.google.com ([209.85.222.193]:34497 "EHLO mail-qk1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728626AbfHUMzw (ORCPT ); Wed, 21 Aug 2019 08:55:52 -0400 Received: by mail-qk1-f193.google.com with SMTP id m10so1688381qkk.1 for ; Wed, 21 Aug 2019 05:55:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Im1BQWra9a4owWUT8RgHgoF9dvQvnpJmlT3+mhtCgoE=; b=UPB2yYVqL11rw/8JcJtyRckbAB8TMsSQlLsO1sZnlRr7OWWSVn1qGXk/BbnNfmMqZz OFr1YF2LwDFVCVLWkYmhv9C02+s0BNku0oQHq7D7gT/N0dSBTpqVdTwszY7oYB14y8Hd LKz0zoyRRWj3SYH36glpC8nEWpP0ou8LpeiwA5Dk0cCgEZcxw+4fEBmGc9ajJXN8MD9P lutwenSIH3zEQL9FY8bLqd4ERg07A3f9Pxo2YDnYyr/JDZHOcouRXePg0b+aLoMMJMJL ShLp1EQ02Spd+FfLglFjKyxCrHotYSoUGWs34ptu2viXpyFw+jYDzRJwjq2Jox2JV/FV 6WWA== 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; bh=Im1BQWra9a4owWUT8RgHgoF9dvQvnpJmlT3+mhtCgoE=; b=SpFaGfPybBerQvmuyu4ysF4SfflD5zVHrHtBcDZfda0kjd8x9k1wqeUVjaEKZsBR9R JLbufJ6X3ZzLSpXS+dlW6USVSciFNFqbUFENIe5qkbqb7qY6IbPrLd0NPlqnuTgpPpjV +t0yYaIAM/p/o7II9iBjQ3elxy9qoFL+TcRPaHW7s0PmH6TNRFawAcvSFYD5sqRKJIBK TT4P8EFQKLfh+BVDTeH73SozXJHPUukhldBwRbxPiZqx1e7MyieAXwbEyosc11qDwJs2 7o0huKaVIZ+vKfU2tEXiKEcr8kJ8NEC1BWA9fW+mmhdMu/EBVLtLVAQptKRPOwiL0knU A21w== X-Gm-Message-State: APjAAAV7nZ/dnTQEVNwmmBLc7Fwm1kqTAp8wQ0dI0DyGHxW0w+Py42gF eiv07fne6towBtp7/OU7lMwMtJBP1I3BeWs/ke/siw== X-Received: by 2002:a05:620a:143b:: with SMTP id k27mr7693095qkj.127.1566392151546; Wed, 21 Aug 2019 05:55:51 -0700 (PDT) MIME-Version: 1.0 References: <534b5017c2210ba8d541c206dace204d6617b4c9.1564091601.git.amit.kucheria@linaro.org> <5d577d77.1c69fb81.b6b07.83e6@mx.google.com> <5d5ab1e0.1c69fb81.d71db.1ca3@mx.google.com> In-Reply-To: <5d5ab1e0.1c69fb81.d71db.1ca3@mx.google.com> From: Amit Kucheria Date: Wed, 21 Aug 2019 18:25:39 +0530 Message-ID: Subject: Re: [PATCH 04/15] drivers: thermal: tsens: Add debugfs support To: Stephen Boyd Cc: Andy Gross , Daniel Lezcano , Mark Rutland , Rob Herring , Zhang Rui , Andy Gross , Bjorn Andersson , Eduardo Valentin , linux-arm-msm , LKML , Linux PM list Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 wrote: > > > > + > > > > +static void tsens_debug_init(struct platform_device *pdev) > > > > +{ > > > > + struct tsens_priv *priv = platform_get_drvdata(pdev); > > > > + struct dentry *root, *file; > > > > + > > > > + root = 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. So I didn't quite understand this statement. The change you're requesting is that the 'root' variable below should be a global? 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. > > > > > > + if (!root) > > > > + priv->debug_root = debugfs_create_dir("tsens", NULL); > > > > + else > > > > + priv->debug_root = root; > > > > +