diff mbox series

[v2,09/36] coresight: catu: Cleanup device specific data

Message ID 1555344260-12375-10-git-send-email-suzuki.poulose@arm.com (mailing list archive)
State New, archived
Headers show
Series coresight: Support for ACPI bindings | expand

Commit Message

Suzuki K Poulose April 15, 2019, 4:03 p.m. UTC
Switch to using the CoreSight device instead of the real
amba device.

Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
---
 drivers/hwtracing/coresight/coresight-catu.c | 13 +++++++------
 drivers/hwtracing/coresight/coresight-catu.h |  1 -
 2 files changed, 7 insertions(+), 7 deletions(-)

Comments

Mathieu Poirier April 17, 2019, 9:40 p.m. UTC | #1
On Mon, Apr 15, 2019 at 05:03:52PM +0100, Suzuki K Poulose wrote:
> Switch to using the CoreSight device instead of the real
> amba device.
> 
> Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
> Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
> ---
>  drivers/hwtracing/coresight/coresight-catu.c | 13 +++++++------
>  drivers/hwtracing/coresight/coresight-catu.h |  1 -
>  2 files changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/hwtracing/coresight/coresight-catu.c b/drivers/hwtracing/coresight/coresight-catu.c
> index ba3c005..14d1cf5 100644
> --- a/drivers/hwtracing/coresight/coresight-catu.c
> +++ b/drivers/hwtracing/coresight/coresight-catu.c
> @@ -408,13 +408,14 @@ static int catu_enable_hw(struct catu_drvdata *drvdata, void *data)
>  	int rc;
>  	u32 control, mode;
>  	struct etr_buf *etr_buf = data;
> +	struct device *dev = &drvdata->csdev->dev;
>  
>  	if (catu_wait_for_ready(drvdata))
> -		dev_warn(drvdata->dev, "Timeout while waiting for READY\n");
> +		dev_warn(dev, "Timeout while waiting for READY\n");
>  
>  	control = catu_read_control(drvdata);
>  	if (control & BIT(CATU_CONTROL_ENABLE)) {
> -		dev_warn(drvdata->dev, "CATU is already enabled\n");
> +		dev_warn(dev, "CATU is already enabled\n");
>  		return -EBUSY;
>  	}
>  
> @@ -440,7 +441,7 @@ static int catu_enable_hw(struct catu_drvdata *drvdata, void *data)
>  	catu_write_irqen(drvdata, 0);
>  	catu_write_mode(drvdata, mode);
>  	catu_write_control(drvdata, control);
> -	dev_dbg(drvdata->dev, "Enabled in %s mode\n",
> +	dev_dbg(dev, "Enabled in %s mode\n",
>  		(mode == CATU_MODE_PASS_THROUGH) ?
>  		"Pass through" :
>  		"Translate");
> @@ -461,15 +462,16 @@ static int catu_enable(struct coresight_device *csdev, void *data)
>  static int catu_disable_hw(struct catu_drvdata *drvdata)
>  {
>  	int rc = 0;
> +	struct device *dev = &drvdata->csdev->dev;
>  
>  	catu_write_control(drvdata, 0);
>  	coresight_disclaim_device_unlocked(drvdata->base);
>  	if (catu_wait_for_ready(drvdata)) {
> -		dev_info(drvdata->dev, "Timeout while waiting for READY\n");
> +		dev_info(dev, "Timeout while waiting for READY\n");
>  		rc = -EAGAIN;
>  	}
>  
> -	dev_dbg(drvdata->dev, "Disabled\n");
> +	dev_dbg(dev, "Disabled\n");
>  	return rc;
>  }
>  
> @@ -519,7 +521,6 @@ static int catu_probe(struct amba_device *adev, const struct amba_id *id)
>  		goto out;
>  	}
>  
> -	drvdata->dev = dev;
>  	dev_set_drvdata(dev, drvdata);
>  	base = devm_ioremap_resource(dev, &adev->res);
>  	if (IS_ERR(base)) {
> diff --git a/drivers/hwtracing/coresight/coresight-catu.h b/drivers/hwtracing/coresight/coresight-catu.h
> index 1b281f0..96ea8c4 100644
> --- a/drivers/hwtracing/coresight/coresight-catu.h
> +++ b/drivers/hwtracing/coresight/coresight-catu.h
> @@ -61,7 +61,6 @@
>  #define CATU_IRQEN_OFF		0x0
>  
>  struct catu_drvdata {
> -	struct device *dev;
>  	void __iomem *base;
>  	struct coresight_device *csdev;
>  	int irq;

Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org>

> -- 
> 2.7.4
>
diff mbox series

Patch

diff --git a/drivers/hwtracing/coresight/coresight-catu.c b/drivers/hwtracing/coresight/coresight-catu.c
index ba3c005..14d1cf5 100644
--- a/drivers/hwtracing/coresight/coresight-catu.c
+++ b/drivers/hwtracing/coresight/coresight-catu.c
@@ -408,13 +408,14 @@  static int catu_enable_hw(struct catu_drvdata *drvdata, void *data)
 	int rc;
 	u32 control, mode;
 	struct etr_buf *etr_buf = data;
+	struct device *dev = &drvdata->csdev->dev;
 
 	if (catu_wait_for_ready(drvdata))
-		dev_warn(drvdata->dev, "Timeout while waiting for READY\n");
+		dev_warn(dev, "Timeout while waiting for READY\n");
 
 	control = catu_read_control(drvdata);
 	if (control & BIT(CATU_CONTROL_ENABLE)) {
-		dev_warn(drvdata->dev, "CATU is already enabled\n");
+		dev_warn(dev, "CATU is already enabled\n");
 		return -EBUSY;
 	}
 
@@ -440,7 +441,7 @@  static int catu_enable_hw(struct catu_drvdata *drvdata, void *data)
 	catu_write_irqen(drvdata, 0);
 	catu_write_mode(drvdata, mode);
 	catu_write_control(drvdata, control);
-	dev_dbg(drvdata->dev, "Enabled in %s mode\n",
+	dev_dbg(dev, "Enabled in %s mode\n",
 		(mode == CATU_MODE_PASS_THROUGH) ?
 		"Pass through" :
 		"Translate");
@@ -461,15 +462,16 @@  static int catu_enable(struct coresight_device *csdev, void *data)
 static int catu_disable_hw(struct catu_drvdata *drvdata)
 {
 	int rc = 0;
+	struct device *dev = &drvdata->csdev->dev;
 
 	catu_write_control(drvdata, 0);
 	coresight_disclaim_device_unlocked(drvdata->base);
 	if (catu_wait_for_ready(drvdata)) {
-		dev_info(drvdata->dev, "Timeout while waiting for READY\n");
+		dev_info(dev, "Timeout while waiting for READY\n");
 		rc = -EAGAIN;
 	}
 
-	dev_dbg(drvdata->dev, "Disabled\n");
+	dev_dbg(dev, "Disabled\n");
 	return rc;
 }
 
@@ -519,7 +521,6 @@  static int catu_probe(struct amba_device *adev, const struct amba_id *id)
 		goto out;
 	}
 
-	drvdata->dev = dev;
 	dev_set_drvdata(dev, drvdata);
 	base = devm_ioremap_resource(dev, &adev->res);
 	if (IS_ERR(base)) {
diff --git a/drivers/hwtracing/coresight/coresight-catu.h b/drivers/hwtracing/coresight/coresight-catu.h
index 1b281f0..96ea8c4 100644
--- a/drivers/hwtracing/coresight/coresight-catu.h
+++ b/drivers/hwtracing/coresight/coresight-catu.h
@@ -61,7 +61,6 @@ 
 #define CATU_IRQEN_OFF		0x0
 
 struct catu_drvdata {
-	struct device *dev;
 	void __iomem *base;
 	struct coresight_device *csdev;
 	int irq;