Linux Power Management development
 help / color / mirror / Atom feed
From: "thermal-bot for Christian Marangi" <tip-bot2@linutronix.de>
To: linux-pm@vger.kernel.org
Cc: Christian Marangi <ansuelsmth@gmail.com>,
	Thara Gopinath <thara.gopinath@linaro.org>,
	Daniel Lezcano <daniel.lezcano@kernel.org>,
	rui.zhang@intel.com, daniel.lezcano@linaro.org, amitk@kernel.org
Subject: [thermal: thermal/next] thermal/drivers/qcom/tsens: Init debugfs only with successful probe
Date: Fri, 09 Dec 2022 15:26:29 -0000	[thread overview]
Message-ID: <167059958938.4906.8038603702843511422.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20221022125657.22530-2-ansuelsmth@gmail.com>

The following commit has been merged into the thermal/next branch of thermal:

Commit-ID:     4d248fcb7c80e67dc22338ed44e00ac5d96ab0be
Gitweb:        https://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux.git//4d248fcb7c80e67dc22338ed44e00ac5d96ab0be
Author:        Christian Marangi <ansuelsmth@gmail.com>
AuthorDate:    Sat, 22 Oct 2022 14:56:55 +02:00
Committer:     Daniel Lezcano <daniel.lezcano@kernel.org>
CommitterDate: Thu, 08 Dec 2022 14:30:44 +01:00

thermal/drivers/qcom/tsens: Init debugfs only with successful probe

Calibrate and tsens_register can fail or PROBE_DEFER. This will cause a
double or a wrong init of the debugfs information. Init debugfs only
with successful probe fixing warning about directory already present.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Acked-by: Thara Gopinath <thara.gopinath@linaro.org>
Link: https://lore.kernel.org/r/20221022125657.22530-2-ansuelsmth@gmail.com
Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org>
---
 drivers/thermal/qcom/tsens.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/thermal/qcom/tsens.c b/drivers/thermal/qcom/tsens.c
index b7d9782..3ac7804 100644
--- a/drivers/thermal/qcom/tsens.c
+++ b/drivers/thermal/qcom/tsens.c
@@ -939,8 +939,6 @@ int __init init_common(struct tsens_priv *priv)
 	if (tsens_version(priv) >= VER_0_1)
 		tsens_enable_irq(priv);
 
-	tsens_debug_init(op);
-
 err_put_device:
 	put_device(&op->dev);
 	return ret;
@@ -1182,7 +1180,11 @@ static int tsens_probe(struct platform_device *pdev)
 		}
 	}
 
-	return tsens_register(priv);
+	ret = tsens_register(priv);
+	if (!ret)
+		tsens_debug_init(pdev);
+
+	return ret;
 }
 
 static int tsens_remove(struct platform_device *pdev)

  reply	other threads:[~2022-12-09 15:26 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-bot for Christian Marangi [this message]
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
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=167059958938.4906.8038603702843511422.tip-bot2@tip-bot2 \
    --to=tip-bot2@linutronix.de \
    --cc=amitk@kernel.org \
    --cc=ansuelsmth@gmail.com \
    --cc=daniel.lezcano@kernel.org \
    --cc=daniel.lezcano@linaro.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rui.zhang@intel.com \
    --cc=thara.gopinath@linaro.org \
    /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