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,
	mathieu.poirier@linaro.org, mike.leach@linaro.org,
	rjw@rjwysocki.net, robert.walker@arm.com,
	Suzuki K Poulose <suzuki.poulose@arm.com>
Subject: [PATCH v2 13/36] coresight: etb10: Clean up device specific data
Date: Mon, 15 Apr 2019 17:03:56 +0100	[thread overview]
Message-ID: <1555344260-12375-14-git-send-email-suzuki.poulose@arm.com> (raw)
In-Reply-To: <1555344260-12375-1-git-send-email-suzuki.poulose@arm.com>

Track the coresight device instead of the real device.

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

diff --git a/drivers/hwtracing/coresight/coresight-etb10.c b/drivers/hwtracing/coresight/coresight-etb10.c
index 13c0a60..6e6e9aa 100644
--- a/drivers/hwtracing/coresight/coresight-etb10.c
+++ b/drivers/hwtracing/coresight/coresight-etb10.c
@@ -65,7 +65,6 @@
 /**
  * struct etb_drvdata - specifics associated to an ETB 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 ETB.
  * @csdev:	component vitals needed by the framework.
  * @miscdev:	specifics to handle "/dev/xyz.etb" entry.
@@ -78,7 +77,6 @@
  */
 struct etb_drvdata {
 	void __iomem		*base;
-	struct device		*dev;
 	struct clk		*atclk;
 	struct coresight_device	*csdev;
 	struct miscdevice	miscdev;
@@ -199,7 +197,6 @@ static int etb_enable_perf(struct coresight_device *csdev, void *data)
 static int etb_enable(struct coresight_device *csdev, u32 mode, void *data)
 {
 	int ret;
-	struct etb_drvdata *drvdata = dev_get_drvdata(csdev->dev.parent);
 
 	switch (mode) {
 	case CS_MODE_SYSFS:
@@ -216,13 +213,14 @@ static int etb_enable(struct coresight_device *csdev, u32 mode, void *data)
 	if (ret)
 		return ret;
 
-	dev_dbg(drvdata->dev, "ETB enabled\n");
+	dev_dbg(&csdev->dev, "ETB enabled\n");
 	return 0;
 }
 
 static void __etb_disable_hw(struct etb_drvdata *drvdata)
 {
 	u32 ffcr;
+	struct device *dev = &drvdata->csdev->dev;
 
 	CS_UNLOCK(drvdata->base);
 
@@ -235,7 +233,7 @@ static void __etb_disable_hw(struct etb_drvdata *drvdata)
 	writel_relaxed(ffcr, drvdata->base + ETB_FFCR);
 
 	if (coresight_timeout(drvdata->base, ETB_FFCR, ETB_FFCR_BIT, 0)) {
-		dev_err(drvdata->dev,
+		dev_err(dev,
 		"timeout while waiting for completion of Manual Flush\n");
 	}
 
@@ -243,7 +241,7 @@ static void __etb_disable_hw(struct etb_drvdata *drvdata)
 	writel_relaxed(0x0, drvdata->base + ETB_CTL_REG);
 
 	if (coresight_timeout(drvdata->base, ETB_FFSR, ETB_FFSR_BIT, 1)) {
-		dev_err(drvdata->dev,
+		dev_err(dev,
 			"timeout while waiting for Formatter to Stop\n");
 	}
 
@@ -258,6 +256,7 @@ static void etb_dump_hw(struct etb_drvdata *drvdata)
 	u32 read_data, depth;
 	u32 read_ptr, write_ptr;
 	u32 frame_off, frame_endoff;
+	struct device *dev = &drvdata->csdev->dev;
 
 	CS_UNLOCK(drvdata->base);
 
@@ -267,10 +266,10 @@ static void etb_dump_hw(struct etb_drvdata *drvdata)
 	frame_off = write_ptr % ETB_FRAME_SIZE_WORDS;
 	frame_endoff = ETB_FRAME_SIZE_WORDS - frame_off;
 	if (frame_off) {
-		dev_err(drvdata->dev,
+		dev_err(dev,
 			"write_ptr: %lu not aligned to formatter frame size\n",
 			(unsigned long)write_ptr);
-		dev_err(drvdata->dev, "frameoff: %lu, frame_endoff: %lu\n",
+		dev_err(dev, "frameoff: %lu, frame_endoff: %lu\n",
 			(unsigned long)frame_off, (unsigned long)frame_endoff);
 		write_ptr += frame_endoff;
 	}
@@ -331,7 +330,7 @@ static void etb_disable(struct coresight_device *csdev)
 	}
 	spin_unlock_irqrestore(&drvdata->spinlock, flags);
 
-	dev_dbg(drvdata->dev, "ETB disabled\n");
+	dev_dbg(&csdev->dev, "ETB disabled\n");
 }
 
 static void *etb_alloc_buffer(struct coresight_device *csdev, int cpu,
@@ -418,7 +417,7 @@ static unsigned long etb_update_buffer(struct coresight_device *csdev,
 	 * chance to fix things.
 	 */
 	if (write_ptr % ETB_FRAME_SIZE_WORDS) {
-		dev_err(drvdata->dev,
+		dev_err(&csdev->dev,
 			"write_ptr: %lu not aligned to formatter frame size\n",
 			(unsigned long)write_ptr);
 
@@ -543,7 +542,7 @@ static void etb_dump(struct etb_drvdata *drvdata)
 	}
 	spin_unlock_irqrestore(&drvdata->spinlock, flags);
 
-	dev_dbg(drvdata->dev, "ETB dumped\n");
+	dev_dbg(&drvdata->csdev->dev, "ETB dumped\n");
 }
 
 static int etb_open(struct inode *inode, struct file *file)
@@ -554,7 +553,7 @@ static int etb_open(struct inode *inode, struct file *file)
 	if (local_cmpxchg(&drvdata->reading, 0, 1))
 		return -EBUSY;
 
-	dev_dbg(drvdata->dev, "%s: successfully opened\n", __func__);
+	dev_dbg(&drvdata->csdev->dev, "%s: successfully opened\n", __func__);
 	return 0;
 }
 
@@ -564,6 +563,7 @@ static ssize_t etb_read(struct file *file, char __user *data,
 	u32 depth;
 	struct etb_drvdata *drvdata = container_of(file->private_data,
 						   struct etb_drvdata, miscdev);
+	struct device *dev = &drvdata->csdev->dev;
 
 	etb_dump(drvdata);
 
@@ -572,13 +572,14 @@ static ssize_t etb_read(struct file *file, char __user *data,
 		len = depth * 4 - *ppos;
 
 	if (copy_to_user(data, drvdata->buf + *ppos, len)) {
-		dev_dbg(drvdata->dev, "%s: copy_to_user failed\n", __func__);
+		dev_dbg(dev,
+			"%s: copy_to_user failed\n", __func__);
 		return -EFAULT;
 	}
 
 	*ppos += len;
 
-	dev_dbg(drvdata->dev, "%s: %zu bytes copied, %d bytes left\n",
+	dev_dbg(dev, "%s: %zu bytes copied, %d bytes left\n",
 		__func__, len, (int)(depth * 4 - *ppos));
 	return len;
 }
@@ -589,7 +590,7 @@ static int etb_release(struct inode *inode, struct file *file)
 						   struct etb_drvdata, miscdev);
 	local_set(&drvdata->reading, 0);
 
-	dev_dbg(drvdata->dev, "%s: released\n", __func__);
+	dev_dbg(&drvdata->csdev->dev, "%s: released\n", __func__);
 	return 0;
 }
 
@@ -693,7 +694,6 @@ static int etb_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);
-- 
2.7.4


  parent reply	other threads:[~2019-04-15 16:06 UTC|newest]

Thread overview: 74+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-15 16:03 [PATCH v2 00/36] coresight: Support for ACPI bindings Suzuki K Poulose
2019-04-15 16:03 ` [PATCH v2 01/36] coresight: Fix freeing up the coresight connections Suzuki K Poulose
2019-04-15 16:03 ` [PATCH v2 02/36] coresight: etb10: Cleanup power management Suzuki K Poulose
2019-04-15 16:03 ` [PATCH v2 03/36] coresight: tpiu: " Suzuki K Poulose
2019-04-15 16:03 ` [PATCH v2 04/36] coresight: catu: " Suzuki K Poulose
2019-04-15 16:03 ` [PATCH v2 05/36] coresight: tmc: " Suzuki K Poulose
2019-04-17 20:03   ` Mathieu Poirier
2019-04-23  9:33     ` Suzuki K Poulose
2019-04-15 16:03 ` [PATCH v2 06/36] coresight: funnel: Clean up device book keeping Suzuki K Poulose
2019-04-17 20:14   ` Mathieu Poirier
2019-04-15 16:03 ` [PATCH v2 07/36] coresight: replicator: Cleanup device tracking Suzuki K Poulose
2019-04-17 20:34   ` Mathieu Poirier
2019-04-15 16:03 ` [PATCH v2 08/36] coresight: tmc: Clean up device specific data Suzuki K Poulose
2019-04-17 21:23   ` Mathieu Poirier
2019-05-03 17:13     ` Suzuki K Poulose
2019-04-15 16:03 ` [PATCH v2 09/36] coresight: catu: Cleanup " Suzuki K Poulose
2019-04-17 21:40   ` Mathieu Poirier
2019-04-15 16:03 ` [PATCH v2 10/36] coresight: tpiu: Clean up " Suzuki K Poulose
2019-04-17 21:41   ` Mathieu Poirier
2019-04-15 16:03 ` [PATCH v2 11/36] coresight: stm: Cleanup " Suzuki K Poulose
2019-04-18 16:50   ` Mathieu Poirier
2019-04-15 16:03 ` [PATCH v2 12/36] coresight: etm: Clean up " Suzuki K Poulose
2019-04-15 16:03 ` Suzuki K Poulose [this message]
2019-04-15 16:03 ` [PATCH v2 14/36] coresight: Rename of_coresight to coresight-platform Suzuki K Poulose
2019-04-18 17:22   ` Mathieu Poirier
2019-04-15 16:03 ` [PATCH v2 15/36] coresight: etm3x: Rearrange cp14 access detection Suzuki K Poulose
2019-04-15 16:03 ` [PATCH v2 16/36] coresight: stm: Rearrange probing the stimulus area Suzuki K Poulose
2019-04-15 16:04 ` [PATCH v2 17/36] coresight: tmc-etr: Rearrange probing default buffer size Suzuki K Poulose
2019-04-15 16:04 ` [PATCH v2 18/36] coresight: platform: Make memory allocation helper generic Suzuki K Poulose
2019-04-15 16:04 ` [PATCH v2 19/36] coresight: Introduce generic platform data helper Suzuki K Poulose
2019-04-22 18:09   ` Mathieu Poirier
2019-04-23  9:43     ` Suzuki K Poulose
2019-04-15 16:04 ` [PATCH v2 20/36] coresight: Make device to CPU mapping generic Suzuki K Poulose
2019-04-18 18:14   ` Mathieu Poirier
2019-04-15 16:04 ` [PATCH v2 21/36] coresight: Remove cpu field from platform data Suzuki K Poulose
2019-04-15 16:04 ` [PATCH v2 22/36] coresight: Remove name from platform description Suzuki K Poulose
2019-04-15 16:04 ` [PATCH v2 23/36] coresight: Cleanup coresight_remove_conns Suzuki K Poulose
2019-04-15 16:04 ` [PATCH v2 24/36] coresight: Reuse platform data structure for connection tracking Suzuki K Poulose
2019-04-22 17:06   ` Mathieu Poirier
2019-04-15 16:04 ` [PATCH v2 25/36] coresight: Rearrange platform data probing Suzuki K Poulose
2019-04-22 17:16   ` Mathieu Poirier
2019-04-25 17:12     ` Suzuki K Poulose
2019-04-15 16:04 ` [PATCH v2 26/36] coresight: Add support for releasing platform specific data Suzuki K Poulose
2019-04-15 16:04 ` [PATCH v2 27/36] drivers: Add a generic helper to match device by fwnode handle Suzuki K Poulose
2019-04-16 10:20   ` Rafael J. Wysocki
2019-04-16 10:34     ` Suzuki K Poulose
2019-04-16 10:45       ` Rafael J. Wysocki
2019-04-16 10:39   ` [RESEND][PATCH " Suzuki K Poulose
2019-04-16 10:48     ` Rafael J. Wysocki
2019-04-16 10:56       ` Suzuki K Poulose
2019-04-18 14:39         ` Rafael J. Wysocki
2019-04-18 15:18           ` Suzuki K Poulose
2019-04-15 16:04 ` [PATCH v2 28/36] coresight: platform: Use fwnode handle for device search Suzuki K Poulose
2019-04-23 16:17   ` Mathieu Poirier
2019-04-15 16:04 ` [PATCH v2 29/36] coresight: Use fwnode handle instead of device names Suzuki K Poulose
2019-04-23 16:14   ` Mathieu Poirier
2019-04-15 16:04 ` [PATCH v2 30/36] coresight: Use platform agnostic names Suzuki K Poulose
2019-04-23 17:38   ` Mathieu Poirier
2019-04-15 16:04 ` [PATCH v2 31/36] coresight: stm: ACPI support for parsing stimulus base Suzuki K Poulose
2019-04-23 17:59   ` Mathieu Poirier
2019-04-25 16:17     ` Suzuki K Poulose
2019-04-15 16:04 ` [PATCH v2 32/36] coresight: Support for ACPI bindings Suzuki K Poulose
2019-04-25 16:50   ` Mathieu Poirier
2019-04-25 17:30     ` Suzuki K Poulose
2019-04-15 16:04 ` [PATCH v2 33/36] coresight: acpi: Support for components Suzuki K Poulose
2019-04-25 17:45   ` Mathieu Poirier
2019-04-29  8:54     ` Suzuki K Poulose
2019-04-15 16:04 ` [PATCH v2 34/36] [RFC] coresight: Pass coresight_device for coresight_release_platform_data Suzuki K Poulose
2019-04-29 17:40   ` Mathieu Poirier
2019-04-15 16:04 ` [PATCH v2 35/36] [RFC] coresight: add return value for fixup connections Suzuki K Poulose
2019-04-29 17:44   ` Mathieu Poirier
2019-04-15 16:04 ` [PATCH v2 36/36] [RFC] coresight: Expose device connections via sysfs Suzuki K Poulose
2019-04-29 20:50   ` Mathieu Poirier
2019-04-15 16:04 ` [TEST PATCH 37/36][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=1555344260-12375-14-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=mike.leach@linaro.org \
    --cc=rjw@rjwysocki.net \
    --cc=robert.walker@arm.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).