linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Suzuki K Poulose <suzuki.poulose@arm.com>
To: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org, coresight@lists.linaro.org,
	rjw@rjwysocki.net, mathieu.poirier@linaro.org,
	Suzuki K Poulose <suzuki.poulose@arm.com>
Subject: [PATCH v3 06/30] coresight: stm: Cleanup device specific data
Date: Tue,  7 May 2019 11:52:33 +0100	[thread overview]
Message-ID: <1557226378-10131-7-git-send-email-suzuki.poulose@arm.com> (raw)
In-Reply-To: <1557226378-10131-1-git-send-email-suzuki.poulose@arm.com>

Keep track of the STM coresight device which is a child device
of the AMBA device. Since we can get to the coresight_device
from the "device" instance, remove the explicit field.

Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
---
 drivers/hwtracing/coresight/coresight-stm.c | 21 ++++++++++-----------
 1 file changed, 10 insertions(+), 11 deletions(-)

diff --git a/drivers/hwtracing/coresight/coresight-stm.c b/drivers/hwtracing/coresight/coresight-stm.c
index 9f8a844..8f50484 100644
--- a/drivers/hwtracing/coresight/coresight-stm.c
+++ b/drivers/hwtracing/coresight/coresight-stm.c
@@ -110,7 +110,6 @@ struct channel_space {
 /**
  * struct stm_drvdata - specifics associated to an STM component
  * @base:		memory mapped base address for this component.
- * @dev:		the device entity associated to this component.
  * @atclk:		optional clock for the core parts of the STM.
  * @csdev:		component vitals needed by the framework.
  * @spinlock:		only one at a time pls.
@@ -128,7 +127,6 @@ struct channel_space {
  */
 struct stm_drvdata {
 	void __iomem		*base;
-	struct device		*dev;
 	struct clk		*atclk;
 	struct coresight_device	*csdev;
 	spinlock_t		spinlock;
@@ -205,13 +203,13 @@ static int stm_enable(struct coresight_device *csdev,
 	if (val)
 		return -EBUSY;
 
-	pm_runtime_get_sync(drvdata->dev);
+	pm_runtime_get_sync(csdev->dev.parent);
 
 	spin_lock(&drvdata->spinlock);
 	stm_enable_hw(drvdata);
 	spin_unlock(&drvdata->spinlock);
 
-	dev_dbg(drvdata->dev, "STM tracing enabled\n");
+	dev_dbg(&csdev->dev, "STM tracing enabled\n");
 	return 0;
 }
 
@@ -271,10 +269,10 @@ static void stm_disable(struct coresight_device *csdev,
 		/* Wait until the engine has completely stopped */
 		coresight_timeout(drvdata->base, STMTCSR, STMTCSR_BUSY_BIT, 0);
 
-		pm_runtime_put(drvdata->dev);
+		pm_runtime_put(csdev->dev.parent);
 
 		local_set(&drvdata->mode, CS_MODE_DISABLED);
-		dev_dbg(drvdata->dev, "STM tracing disabled\n");
+		dev_dbg(&csdev->dev, "STM tracing disabled\n");
 	}
 }
 
@@ -763,9 +761,10 @@ static void stm_init_default_data(struct stm_drvdata *drvdata)
 	bitmap_clear(drvdata->chs.guaranteed, 0, drvdata->numsp);
 }
 
-static void stm_init_generic_data(struct stm_drvdata *drvdata)
+static void stm_init_generic_data(struct stm_drvdata *drvdata,
+				  const char *name)
 {
-	drvdata->stm.name = dev_name(drvdata->dev);
+	drvdata->stm.name = name;
 
 	/*
 	 * MasterIDs are assigned at HW design phase. As such the core is
@@ -807,7 +806,6 @@ static int stm_probe(struct amba_device *adev, const struct amba_id *id)
 	if (!drvdata)
 		return -ENOMEM;
 
-	drvdata->dev = &adev->dev;
 	drvdata->atclk = devm_clk_get(&adev->dev, "atclk"); /* optional */
 	if (!IS_ERR(drvdata->atclk)) {
 		ret = clk_prepare_enable(drvdata->atclk);
@@ -848,7 +846,7 @@ static int stm_probe(struct amba_device *adev, const struct amba_id *id)
 	spin_lock_init(&drvdata->spinlock);
 
 	stm_init_default_data(drvdata);
-	stm_init_generic_data(drvdata);
+	stm_init_generic_data(drvdata, dev_name(dev));
 
 	if (stm_register_device(dev, &drvdata->stm, THIS_MODULE)) {
 		dev_info(dev,
@@ -870,7 +868,8 @@ static int stm_probe(struct amba_device *adev, const struct amba_id *id)
 
 	pm_runtime_put(&adev->dev);
 
-	dev_info(dev, "%s initialized\n", (char *)coresight_get_uci_data(id));
+	dev_info(&drvdata->csdev->dev, "%s initialized\n",
+		 (char *)coresight_get_uci_data(id));
 	return 0;
 
 stm_unregister:
-- 
2.7.4


  parent reply	other threads:[~2019-05-07 10:56 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-07 10:52 [PATCH v3 00/30] coresight: Support for ACPI bindings Suzuki K Poulose
2019-05-07 10:52 ` [PATCH v3 01/30] coresight: funnel: Clean up device book keeping Suzuki K Poulose
2019-05-07 10:52 ` [PATCH v3 02/30] coresight: replicator: Cleanup device tracking Suzuki K Poulose
2019-05-07 10:52 ` [PATCH v3 03/30] coresight: tmc: Clean up device specific data Suzuki K Poulose
2019-05-07 10:52 ` [PATCH v3 04/30] coresight: catu: Cleanup " Suzuki K Poulose
2019-05-07 10:52 ` [PATCH v3 05/30] coresight: tpiu: Clean up " Suzuki K Poulose
2019-05-07 10:52 ` Suzuki K Poulose [this message]
2019-05-07 10:52 ` [PATCH v3 07/30] coresight: etm: " Suzuki K Poulose
2019-05-07 10:52 ` [PATCH v3 08/30] coresight: etb10: " Suzuki K Poulose
2019-05-07 10:52 ` [PATCH v3 09/30] coresight: Use coresight device names for sinks in PMU attribute Suzuki K Poulose
2019-05-07 10:52 ` [PATCH v3 10/30] coresight: Rename of_coresight to coresight-platform Suzuki K Poulose
2019-05-07 10:52 ` [PATCH v3 11/30] coresight: etm3x: Rearrange cp14 access detection Suzuki K Poulose
2019-05-07 10:52 ` [PATCH v3 12/30] coresight: stm: Rearrange probing the stimulus area Suzuki K Poulose
2019-05-07 10:52 ` [PATCH v3 13/30] coresight: tmc-etr: Rearrange probing default buffer size Suzuki K Poulose
2019-05-07 10:52 ` [PATCH v3 14/30] coresight: platform: Make memory allocation helper generic Suzuki K Poulose
2019-05-07 10:52 ` [PATCH v3 15/30] coresight: Make sure device uses DT for obsolete compatible check Suzuki K Poulose
2019-05-13 16:18   ` Mathieu Poirier
2019-05-07 10:52 ` [PATCH v3 16/30] coresight: Introduce generic platform data helper Suzuki K Poulose
2019-05-13 16:39   ` Mathieu Poirier
2019-05-07 10:52 ` [PATCH v3 17/30] coresight: Make device to CPU mapping generic Suzuki K Poulose
2019-05-07 10:52 ` [PATCH v3 18/30] coresight: Remove cpu field from platform data Suzuki K Poulose
2019-05-07 10:52 ` [PATCH v3 19/30] coresight: Remove name from platform description Suzuki K Poulose
2019-05-07 10:52 ` [PATCH v3 20/30] coresight: Cleanup coresight_remove_conns Suzuki K Poulose
2019-05-07 10:52 ` [PATCH v3 21/30] coresight: Reuse platform data structure for connection tracking Suzuki K Poulose
2019-05-07 10:52 ` [PATCH v3 22/30] coresight: Rearrange platform data probing Suzuki K Poulose
2019-05-13 17:21   ` Mathieu Poirier
2019-05-07 10:52 ` [PATCH v3 23/30] coresight: Add support for releasing platform specific data Suzuki K Poulose
2019-05-13 22:40   ` Mathieu Poirier
2019-05-07 10:52 ` [PATCH v3 24/30] coresight: platform: Use fwnode handle for device search Suzuki K Poulose
2019-05-13 17:39   ` Mathieu Poirier
2019-05-07 10:52 ` [PATCH v3 25/30] coresight: Use fwnode handle instead of device names Suzuki K Poulose
2019-05-13 17:59   ` Mathieu Poirier
2019-05-07 10:52 ` [PATCH v3 26/30] coresight: Use platform agnostic names Suzuki K Poulose
2019-05-07 10:52 ` [PATCH v3 27/30] coresight: stm: ACPI support for parsing stimulus base Suzuki K Poulose
2019-05-07 10:52 ` [PATCH v3 28/30] coresight: Support for ACPI bindings Suzuki K Poulose
2019-05-13 22:28   ` Mathieu Poirier
2019-05-07 10:52 ` [PATCH v3 29/30] coresight: acpi: Support for AMBA components Suzuki K Poulose
2019-05-13 22:33   ` Mathieu Poirier
2019-05-07 10:52 ` [PATCH v3 30/30] coresight: acpi: Support for platform devices Suzuki K Poulose
2019-05-07 10:52 ` [TEST PATCH 31/30][EDK2] edk2-platform: juno: Update ACPI CoreSight Bindings Suzuki K Poulose

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=1557226378-10131-7-git-send-email-suzuki.poulose@arm.com \
    --to=suzuki.poulose@arm.com \
    --cc=coresight@lists.linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.poirier@linaro.org \
    --cc=rjw@rjwysocki.net \
    /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).