coresight: funnel: Clean up device book keeping
authorSuzuki K Poulose <suzuki.poulose@arm.com>
Wed, 19 Jun 2019 17:29:10 +0000 (11:29 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 Jun 2019 18:29:14 +0000 (20:29 +0200)
In preparation to use a consistent device naming scheme,
clean up the device link tracking in funnel driver.
Use the "coresight" device instead of the "real" parent device
for all internal purposes. All other requests (e.g, power management,
DMA operations) must use the "real" device which is the parent device.

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-funnel.c

index 16b0c0e..6236a84 100644 (file)
 /**
  * struct funnel_drvdata - specifics associated to a funnel 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 funnel.
  * @csdev:     component vitals needed by the framework.
  * @priority:  port selection order.
  */
 struct funnel_drvdata {
        void __iomem            *base;
-       struct device           *dev;
        struct clk              *atclk;
        struct coresight_device *csdev;
        unsigned long           priority;
@@ -80,7 +78,7 @@ static int funnel_enable(struct coresight_device *csdev, int inport,
                rc = dynamic_funnel_enable_hw(drvdata, inport);
 
        if (!rc)
-               dev_dbg(drvdata->dev, "FUNNEL inport %d enabled\n", inport);
+               dev_dbg(&csdev->dev, "FUNNEL inport %d enabled\n", inport);
        return rc;
 }
 
@@ -110,7 +108,7 @@ static void funnel_disable(struct coresight_device *csdev, int inport,
        if (drvdata->base)
                dynamic_funnel_disable_hw(drvdata, inport);
 
-       dev_dbg(drvdata->dev, "FUNNEL inport %d disabled\n", inport);
+       dev_dbg(&csdev->dev, "FUNNEL inport %d disabled\n", inport);
 }
 
 static const struct coresight_ops_link funnel_link_ops = {
@@ -165,11 +163,11 @@ static ssize_t funnel_ctrl_show(struct device *dev,
        u32 val;
        struct funnel_drvdata *drvdata = dev_get_drvdata(dev->parent);
 
-       pm_runtime_get_sync(drvdata->dev);
+       pm_runtime_get_sync(dev->parent);
 
        val = get_funnel_ctrl_hw(drvdata);
 
-       pm_runtime_put(drvdata->dev);
+       pm_runtime_put(dev->parent);
 
        return sprintf(buf, "%#x\n", val);
 }
@@ -205,7 +203,6 @@ static int funnel_probe(struct device *dev, struct resource *res)
        if (!drvdata)
                return -ENOMEM;
 
-       drvdata->dev = dev;
        drvdata->atclk = devm_clk_get(dev, "atclk"); /* optional */
        if (!IS_ERR(drvdata->atclk)) {
                ret = clk_prepare_enable(drvdata->atclk);