From: Christian Marangi <ansuelsmth@gmail.com>
To: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: Amit Kucheria <amitk@kernel.org>,
Thara Gopinath <thara.gopinath@gmail.com>,
Andy Gross <agross@kernel.org>,
Bjorn Andersson <andersson@kernel.org>,
Konrad Dybcio <konrad.dybcio@somainline.org>,
"Rafael J. Wysocki" <rafael@kernel.org>,
Zhang Rui <rui.zhang@intel.com>,
linux-pm@vger.kernel.org, linux-arm-msm@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 3/3] thermal: qcom: tsens: rework debugfs file structure
Date: Sat, 22 Oct 2022 15:10:34 +0200 [thread overview]
Message-ID: <6353ebd1.170a0220.e607e.711a@mx.google.com> (raw)
In-Reply-To: <591f7038-81ed-1850-b525-d02a4e082903@linaro.org>
On Sat, Oct 22, 2022 at 03:08:46PM +0200, Daniel Lezcano wrote:
> On 22/10/2022 14:56, Christian Marangi wrote:
> > The current tsens debugfs structure is composed by:
> > - a tsens dir in debugfs with a version file
> > - a directory for each tsens istance with sensors file to dump all the
> > sensors value.
>
> s/istance/instance/
>
> The patch looks good to me, no need to resend, I'll fix the typos
>
Thanks for picking this, np for fixing typos.
> > This works on the assumption that we have the same version for each
> > istance but this assumption seems fragile and with more than one tsens
> > istance results in the version file not tracking each of them.
> >
> > A better approach is to just create a subdirectory for each tsens
> > istance and put there version and sensors debugfs file.
> >
> > Using this new implementation results in less code since debugfs entry
> > are created only on successful tsens probe.
> >
> > Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
> > ---
> > drivers/thermal/qcom/tsens.c | 13 +++----------
> > 1 file changed, 3 insertions(+), 10 deletions(-)
> >
> > diff --git a/drivers/thermal/qcom/tsens.c b/drivers/thermal/qcom/tsens.c
> > index 467585c45d34..fc12d7c07de4 100644
> > --- a/drivers/thermal/qcom/tsens.c
> > +++ b/drivers/thermal/qcom/tsens.c
> > @@ -704,21 +704,14 @@ DEFINE_SHOW_ATTRIBUTE(dbg_sensors);
> > 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);
> > - if (!root)
> > + priv->debug_root = debugfs_lookup("tsens", NULL);
> > + if (!priv->debug_root)
> > priv->debug_root = debugfs_create_dir("tsens", NULL);
> > - else
> > - priv->debug_root = root;
> > -
> > - file = debugfs_lookup("version", priv->debug_root);
> > - if (!file)
> > - debugfs_create_file("version", 0444, priv->debug_root,
> > - pdev, &dbg_version_fops);
> > /* A directory for each instance of the TSENS IP */
> > priv->debug = debugfs_create_dir(dev_name(&pdev->dev), priv->debug_root);
> > + debugfs_create_file("version", 0444, priv->debug, pdev, &dbg_version_fops);
> > debugfs_create_file("sensors", 0444, priv->debug, pdev, &dbg_sensors_fops);
> > }
> > #else
>
>
> --
> <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs
>
> Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
> <http://twitter.com/#!/linaroorg> Twitter |
> <http://www.linaro.org/linaro-blog/> Blog
--
Ansuel
next prev parent reply other threads:[~2022-10-22 13:10 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-22 12:56 [PATCH v3 0/3] thermal: qcom: tsens: small fixup for debugfs Christian Marangi
2022-10-22 12:56 ` [PATCH v3 1/3] thermal: qcom: tsens: init debugfs only with successful probe Christian Marangi
2022-12-09 15:26 ` [thermal: thermal/next] thermal/drivers/qcom/tsens: Init " thermal-bot for Christian Marangi
2022-10-22 12:56 ` [PATCH v3 2/3] thermal: qcom: tsens: fix wrong version id dbg_version_show Christian Marangi
2022-12-09 15:26 ` [thermal: thermal/next] thermal/drivers/qcom/tsens: Fix " thermal-bot for Christian Marangi
2022-10-22 12:56 ` [PATCH v3 3/3] thermal: qcom: tsens: rework debugfs file structure Christian Marangi
2022-10-22 13:08 ` Daniel Lezcano
2022-10-22 13:10 ` Christian Marangi [this message]
2022-11-07 13:36 ` Christian Marangi
2022-12-09 15:26 ` [thermal: thermal/next] thermal/drivers/qcom/tsens: Rework " thermal-bot for Christian Marangi
2022-10-22 16:26 ` [PATCH v3 0/3] thermal: qcom: tsens: small fixup for debugfs Daniel Lezcano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6353ebd1.170a0220.e607e.711a@mx.google.com \
--to=ansuelsmth@gmail.com \
--cc=agross@kernel.org \
--cc=amitk@kernel.org \
--cc=andersson@kernel.org \
--cc=daniel.lezcano@linaro.org \
--cc=konrad.dybcio@somainline.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rafael@kernel.org \
--cc=rui.zhang@intel.com \
--cc=thara.gopinath@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).