Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp2783592ybl; Mon, 19 Aug 2019 07:29:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqytl62r6HaUkgCG72JLn8YlxEEU78KERVDa85rvOVpj3A83U7bLRDI1COFuIPzNJlszvmAb X-Received: by 2002:a63:fe17:: with SMTP id p23mr20058788pgh.103.1566224950965; Mon, 19 Aug 2019 07:29:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566224950; cv=none; d=google.com; s=arc-20160816; b=ZX5TXi7mayw95Y/JnbWeMz1Mg054+svGGzkXwt5DGyYHU9xF2UwFlaYxrukxoG3qrM SuJPtx2s8cnB6+X6NH5IYQHfWLqbCMMmxy5XgnGambiymq1pMtDFWrsfNpzYKzCyQIHF hrYxSyEBmH70PidcbSI0jj1P5dgbqtFGCuFQW4D/Gi/HurbRVk3VEnTS20+H0LqQBV4v j7vaV9bqqgytUPkiWl8M5iAZHE1Uqd4azUDJDSGjHT8ze3AGwWuBSdFRlA9TvnQ4NyZ2 7qgJsAYBr7GQMdHKpMr/rM4eQmiVf3AbbBG01C/cZieVx11FLAu/afn1mq2zDKfl+HGb l0kw== 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:to:cc:from:subject :references:in-reply-to:content-transfer-encoding:mime-version :message-id:dkim-signature; bh=g7SGcsmWT+FULooaq5UQl7DExj4a8uS1tyyXvhheNb8=; b=quAhtpfUrTc+QDFTFdS1JzVCmtPqLa+JtHdKIEDK7LKn8RGSZI7+z0ksHiC9+6ObeR IXT7Xky6yVFPpX0RV+Awf1MC5WNn+LV2objWucGFnLi3QcUr6Z61coP+VMPEbv/RTa11 bz46v5QeCnkR8uma1dVn2AwZTJii4HuDeoOy9052ykVo65ajggVdL3OXykELnjFR7hAa U+aHrRSwdEAdmYG3KbSBCcu0nwALwxqqpa+e2oJPLA2/MVVAPU1T4HrVdfl10jXLUmCr K6dEok86+vehBvFAywCmuvXAPBTMGzuVRlGzq7mfy6nF0IWUaJWiqpuQ9BjiO7KnySp2 NLAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=F7B++fDf; 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 9si9894053pgo.283.2019.08.19.07.28.56; Mon, 19 Aug 2019 07:29:10 -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=F7B++fDf; 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 S1727212AbfHSO1q (ORCPT + 99 others); Mon, 19 Aug 2019 10:27:46 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:33732 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726553AbfHSO1p (ORCPT ); Mon, 19 Aug 2019 10:27:45 -0400 Received: by mail-pg1-f194.google.com with SMTP id n190so1338945pgn.0 for ; Mon, 19 Aug 2019 07:27:45 -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:subject:from:cc:to:user-agent:date; bh=g7SGcsmWT+FULooaq5UQl7DExj4a8uS1tyyXvhheNb8=; b=F7B++fDfMJYrpdYGvbFTT3qQ489MSEHBL6T0G9stCqDBOS8VcRefaYC4S/enADXJNp 2F7T1EO3zH5+xq2vk+ia2joTDoly6PVLwI68tZno7FJxEBgHJER3kEIIiR5lkPiykppq seC2Gy5QwSdoWPsA3rGIVtNnVLONWrUaIwFJ0= 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:subject:from:cc:to :user-agent:date; bh=g7SGcsmWT+FULooaq5UQl7DExj4a8uS1tyyXvhheNb8=; b=gsO23UNy9IhumNnMP2VaJwou0Fh0jPLdDypkwmLJkJp+SAqC4pGbl7t57BEB0X+WHJ nYeueDP3W5JTJgJ2Q9TsYObxRTh5J4RoHnb3UNmOo1dWMxq17IheAOnuIwqc5k5m0nqX 7hepLNn7fOGQEqF9RNHnH/gzJWSHe9m80xU+VSEYG0Anl6HtjRsL5pGGNeymk5mRsnVC ttNhMlT2IQ6XwDID4Pzm9Y2EtwQNHxHx7XMhTe6MVL7imRHHffhQa3isOSWG1xxoYiu4 Vpuj4h4o6/ajH5mtCnb/NuJxWnvN4v5cfe/ZV21Rq4Op3yBxOS23UAptXP90Gwd9kHtt urTA== X-Gm-Message-State: APjAAAVe+7pkHgrf2yHlRQh7BxJziCu3FC64gkdDEBRzsGeUc4wZM9MJ 28vXLqJfSBuU0r3X7aNs6Cx07A== X-Received: by 2002:a17:90a:650c:: with SMTP id i12mr20834840pjj.11.1566224865078; Mon, 19 Aug 2019 07:27:45 -0700 (PDT) Received: from chromium.org ([2620:15c:202:1:fa53:7765:582b:82b9]) by smtp.gmail.com with ESMTPSA id ay7sm13400421pjb.4.2019.08.19.07.27.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Aug 2019 07:27:44 -0700 (PDT) Message-ID: <5d5ab1e0.1c69fb81.d71db.1ca3@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> Subject: Re: [PATCH 04/15] drivers: thermal: tsens: Add debugfs support From: 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 To: Amit Kucheria User-Agent: alot/0.8.1 Date: Mon, 19 Aug 2019 07:27:43 -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-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 =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? > > >=20 > 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 > > > + if (!root) > > > + priv->debug_root =3D debugfs_create_dir("tsens", NULL= ); > > > + else > > > + priv->debug_root =3D root; > > > +