All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
To: Andy Gross <agross@kernel.org>,
	Bjorn Andersson <bjorn.andersson@linaro.org>,
	Amit Kucheria <amitk@kernel.org>,
	Thara Gopinath <thara.gopinath@gmail.com>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Michael Turquette <mturquette@baylibre.com>,
	Stephen Boyd <sboyd@kernel.org>
Cc: linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org,
	devicetree@vger.kernel.org, linux-clk@vger.kernel.org
Subject: [PATCH v2 3/4] clk: qcom: gcc-msm8960: create tsens device if there are no child nodes
Date: Wed,  6 Apr 2022 03:26:47 +0300	[thread overview]
Message-ID: <20220406002648.393486-4-dmitry.baryshkov@linaro.org> (raw)
In-Reply-To: <20220406002648.393486-1-dmitry.baryshkov@linaro.org>

Currently gcc-msm8960 driver manually creates tsens device. Don't create
it in case there are child nodes inside the gcc device (which would
include the tsens).

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
 drivers/clk/qcom/gcc-msm8960.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/clk/qcom/gcc-msm8960.c b/drivers/clk/qcom/gcc-msm8960.c
index 051745ef99c8..a6e13b91e4c8 100644
--- a/drivers/clk/qcom/gcc-msm8960.c
+++ b/drivers/clk/qcom/gcc-msm8960.c
@@ -3641,6 +3641,9 @@ static int gcc_msm8960_probe(struct platform_device *pdev)
 		hfpll_l2.d = &hfpll_l2_8064_data;
 	}
 
+	if (of_get_available_child_count(pdev->dev.of_node) != 0)
+		return devm_of_platform_populate(&pdev->dev);
+
 	tsens = platform_device_register_data(&pdev->dev, "qcom-tsens", -1,
 					      NULL, 0);
 	if (IS_ERR(tsens))
@@ -3655,7 +3658,8 @@ static int gcc_msm8960_remove(struct platform_device *pdev)
 {
 	struct platform_device *tsens = platform_get_drvdata(pdev);
 
-	platform_device_unregister(tsens);
+	if (tsens)
+		platform_device_unregister(tsens);
 
 	return 0;
 }
-- 
2.35.1


  parent reply	other threads:[~2022-04-06  5:41 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-06  0:26 [PATCH v2 0/4] arm: qcom: qcom-apq8064: add separate device node for tsens Dmitry Baryshkov
2022-04-06  0:26 ` [PATCH v2 1/4] dt-bindings: thermal: qcom-tsens.yaml: add msm8960 compat string Dmitry Baryshkov
2022-04-06  7:57   ` Krzysztof Kozlowski
2022-04-07  9:02   ` Daniel Lezcano
2022-05-19 12:44   ` [thermal: thermal/next] " thermal-bot for Dmitry Baryshkov
2022-04-06  0:26 ` [PATCH v2 2/4] thermal/drivers/tsens: add compat string for the qcom,msm8960 Dmitry Baryshkov
2022-04-07  9:02   ` Daniel Lezcano
2022-05-19 12:44   ` [thermal: thermal/next] thermal/drivers/tsens: Add " thermal-bot for Dmitry Baryshkov
2022-04-06  0:26 ` Dmitry Baryshkov [this message]
2022-04-06  0:26 ` [PATCH v2 4/4] arm: dts: qcom-apq8064: create tsens device node Dmitry Baryshkov
2022-04-06 15:40 ` [PATCH v2 0/4] arm: qcom: qcom-apq8064: add separate device node for tsens Stephen Boyd
2022-04-06 19:57   ` Dmitry Baryshkov
2022-04-12 18:43     ` Stephen Boyd
2022-04-12 19:20       ` Dmitry Baryshkov
2022-04-12 20:08         ` Bjorn Andersson
2022-04-12 20:57           ` Dmitry Baryshkov

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=20220406002648.393486-4-dmitry.baryshkov@linaro.org \
    --to=dmitry.baryshkov@linaro.org \
    --cc=agross@kernel.org \
    --cc=amitk@kernel.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=robh+dt@kernel.org \
    --cc=sboyd@kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.