[13/25] coresight: etb10: Clean up device specific data
diff mbox series

Message ID 1553107783-3340-14-git-send-email-suzuki.poulose@arm.com
State Superseded
Headers show
Series
  • coresight: Support for ACPI bindings
Related show

Commit Message

Suzuki Kuruppassery Poulose March 20, 2019, 6:49 p.m. UTC
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 | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Mathieu Poirier March 27, 2019, 9:39 p.m. UTC | #1
On Wed, Mar 20, 2019 at 06:49:30PM +0000, Suzuki K Poulose wrote:
> 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 | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/hwtracing/coresight/coresight-etb10.c b/drivers/hwtracing/coresight/coresight-etb10.c
> index 105782e..a471cbd 100644
> --- a/drivers/hwtracing/coresight/coresight-etb10.c
> +++ b/drivers/hwtracing/coresight/coresight-etb10.c
> @@ -97,12 +97,12 @@ static unsigned int etb_get_buffer_depth(struct etb_drvdata *drvdata)
>  {
>  	u32 depth = 0;
>  
> -	pm_runtime_get_sync(drvdata->dev);
> +	pm_runtime_get_sync(drvdata->dev->parent);
>  
>  	/* RO registers don't need locking */
>  	depth = readl_relaxed(drvdata->base + ETB_RAM_DEPTH_REG);
>  
> -	pm_runtime_put(drvdata->dev);
> +	pm_runtime_put(drvdata->dev->parent);
>  	return depth;
>  }
>  
> @@ -701,7 +701,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);
> @@ -740,6 +739,7 @@ static int etb_probe(struct amba_device *adev, const struct amba_id *id)
>  	if (IS_ERR(drvdata->csdev))
>  		return PTR_ERR(drvdata->csdev);
>  
> +	drvdata->dev = &drvdata->csdev->dev;

For patch 11, 12, 13 - same comment as earlier.  Let's use drvdata::csdev
and get rid of drvdata::dev.

>  	drvdata->miscdev.name = pdata->name;
>  	drvdata->miscdev.minor = MISC_DYNAMIC_MINOR;
>  	drvdata->miscdev.fops = &etb_fops;
> -- 
> 2.7.4
>
Suzuki Kuruppassery Poulose March 28, 2019, 11:09 a.m. UTC | #2
On 03/27/2019 09:39 PM, Mathieu Poirier wrote:
> On Wed, Mar 20, 2019 at 06:49:30PM +0000, Suzuki K Poulose wrote:
>> 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>

>>   
>> @@ -701,7 +701,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);
>> @@ -740,6 +739,7 @@ static int etb_probe(struct amba_device *adev, const struct amba_id *id)
>>   	if (IS_ERR(drvdata->csdev))
>>   		return PTR_ERR(drvdata->csdev);
>>   
>> +	drvdata->dev = &drvdata->csdev->dev;
> 
> For patch 11, 12, 13 - same comment as earlier.  Let's use drvdata::csdev
> and get rid of drvdata::dev.
> 

Sure, will do.

Thanks for the detailed review !

Suzuki

Patch
diff mbox series

diff --git a/drivers/hwtracing/coresight/coresight-etb10.c b/drivers/hwtracing/coresight/coresight-etb10.c
index 105782e..a471cbd 100644
--- a/drivers/hwtracing/coresight/coresight-etb10.c
+++ b/drivers/hwtracing/coresight/coresight-etb10.c
@@ -97,12 +97,12 @@  static unsigned int etb_get_buffer_depth(struct etb_drvdata *drvdata)
 {
 	u32 depth = 0;
 
-	pm_runtime_get_sync(drvdata->dev);
+	pm_runtime_get_sync(drvdata->dev->parent);
 
 	/* RO registers don't need locking */
 	depth = readl_relaxed(drvdata->base + ETB_RAM_DEPTH_REG);
 
-	pm_runtime_put(drvdata->dev);
+	pm_runtime_put(drvdata->dev->parent);
 	return depth;
 }
 
@@ -701,7 +701,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);
@@ -740,6 +739,7 @@  static int etb_probe(struct amba_device *adev, const struct amba_id *id)
 	if (IS_ERR(drvdata->csdev))
 		return PTR_ERR(drvdata->csdev);
 
+	drvdata->dev = &drvdata->csdev->dev;
 	drvdata->miscdev.name = pdata->name;
 	drvdata->miscdev.minor = MISC_DYNAMIC_MINOR;
 	drvdata->miscdev.fops = &etb_fops;