[v2,05/36] coresight: tmc: Cleanup power management
diff mbox series

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

Commit Message

Suzuki Kuruppassery Poulose April 15, 2019, 4:03 p.m. UTC
Drop the power only if we were successful in probing the device.

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

Comments

Mathieu Poirier April 17, 2019, 8:03 p.m. UTC | #1
On Mon, 15 Apr 2019 at 10:05, Suzuki K Poulose <suzuki.poulose@arm.com> wrote:
>
> Drop the power only if we were successful in probing the device.
>
> Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
> Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
> ---
>  drivers/hwtracing/coresight/coresight-tmc.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/hwtracing/coresight/coresight-tmc.c b/drivers/hwtracing/coresight/coresight-tmc.c
> index 647b6aa..c6a5462 100644
> --- a/drivers/hwtracing/coresight/coresight-tmc.c
> +++ b/drivers/hwtracing/coresight/coresight-tmc.c
> @@ -432,8 +432,6 @@ static int tmc_probe(struct amba_device *adev, const struct amba_id *id)
>                 drvdata->size = readl_relaxed(drvdata->base + TMC_RSZ) * 4;
>         }
>
> -       pm_runtime_put(&adev->dev);
> -
>         desc.pdata = pdata;
>         desc.dev = dev;
>         desc.groups = coresight_tmc_groups;
> @@ -476,6 +474,8 @@ static int tmc_probe(struct amba_device *adev, const struct amba_id *id)
>         ret = misc_register(&drvdata->miscdev);
>         if (ret)
>                 coresight_unregister(drvdata->csdev);
> +       else
> +               pm_runtime_put(&adev->dev);
>  out:
>         return ret;
>  }

I have applied patches 1 to 5.

> --
> 2.7.4
>
Suzuki Kuruppassery Poulose April 23, 2019, 9:33 a.m. UTC | #2
On 04/17/2019 09:03 PM, Mathieu Poirier wrote:
> On Mon, 15 Apr 2019 at 10:05, Suzuki K Poulose <suzuki.poulose@arm.com> wrote:
>>
>> Drop the power only if we were successful in probing the device.
>>
>> Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
>> Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
>> ---
>>   drivers/hwtracing/coresight/coresight-tmc.c | 4 ++--
>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/hwtracing/coresight/coresight-tmc.c b/drivers/hwtracing/coresight/coresight-tmc.c
>> index 647b6aa..c6a5462 100644
>> --- a/drivers/hwtracing/coresight/coresight-tmc.c
>> +++ b/drivers/hwtracing/coresight/coresight-tmc.c
>> @@ -432,8 +432,6 @@ static int tmc_probe(struct amba_device *adev, const struct amba_id *id)
>>                  drvdata->size = readl_relaxed(drvdata->base + TMC_RSZ) * 4;
>>          }
>>
>> -       pm_runtime_put(&adev->dev);
>> -
>>          desc.pdata = pdata;
>>          desc.dev = dev;
>>          desc.groups = coresight_tmc_groups;
>> @@ -476,6 +474,8 @@ static int tmc_probe(struct amba_device *adev, const struct amba_id *id)
>>          ret = misc_register(&drvdata->miscdev);
>>          if (ret)
>>                  coresight_unregister(drvdata->csdev);
>> +       else
>> +               pm_runtime_put(&adev->dev);
>>   out:
>>          return ret;
>>   }
> 
> I have applied patches 1 to 5.

Thanks Mathieu !

Patch
diff mbox series

diff --git a/drivers/hwtracing/coresight/coresight-tmc.c b/drivers/hwtracing/coresight/coresight-tmc.c
index 647b6aa..c6a5462 100644
--- a/drivers/hwtracing/coresight/coresight-tmc.c
+++ b/drivers/hwtracing/coresight/coresight-tmc.c
@@ -432,8 +432,6 @@  static int tmc_probe(struct amba_device *adev, const struct amba_id *id)
 		drvdata->size = readl_relaxed(drvdata->base + TMC_RSZ) * 4;
 	}
 
-	pm_runtime_put(&adev->dev);
-
 	desc.pdata = pdata;
 	desc.dev = dev;
 	desc.groups = coresight_tmc_groups;
@@ -476,6 +474,8 @@  static int tmc_probe(struct amba_device *adev, const struct amba_id *id)
 	ret = misc_register(&drvdata->miscdev);
 	if (ret)
 		coresight_unregister(drvdata->csdev);
+	else
+		pm_runtime_put(&adev->dev);
 out:
 	return ret;
 }