coresight: catu: Cleanup power management
authorSuzuki K Poulose <suzuki.poulose@arm.com>
Thu, 25 Apr 2019 19:52:49 +0000 (13:52 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Apr 2019 20:00:16 +0000 (22:00 +0200)
Drop the power handle only if we were successful. Otherwise
the AMBA bus code would do the rest.

Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hwtracing/coresight/coresight-catu.c

index 057627a..4ea68a3 100644 (file)
@@ -557,8 +557,9 @@ static int catu_probe(struct amba_device *adev, const struct amba_id *id)
        drvdata->csdev = coresight_register(&catu_desc);
        if (IS_ERR(drvdata->csdev))
                ret = PTR_ERR(drvdata->csdev);
+       else
+               pm_runtime_put(&adev->dev);
 out:
-       pm_runtime_put(&adev->dev);
        return ret;
 }