coresight: Remove cpu field from platform data
authorSuzuki K Poulose <suzuki.poulose@arm.com>
Wed, 19 Jun 2019 19:52:56 +0000 (13:52 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 20 Jun 2019 05:56:12 +0000 (07:56 +0200)
CPU field is only used by ETMs and there is a separate API
for fetching the same. So, let us use that instead of using
the common platform probing helper. Also, remove it from the
platform_data.

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-etm3x.c
drivers/hwtracing/coresight/coresight-etm4x.c
drivers/hwtracing/coresight/coresight-platform.c
include/linux/coresight.h

index fa2164f..722fab9 100644 (file)
@@ -819,7 +819,7 @@ static int etm_probe(struct amba_device *adev, const struct amba_id *id)
                        return ret;
        }
 
-       drvdata->cpu = pdata ? pdata->cpu : 0;
+       drvdata->cpu = coresight_get_cpu(dev);
 
        cpus_read_lock();
        etmdrvdata[drvdata->cpu] = drvdata;
index 4355b2e..03576f3 100644 (file)
@@ -1105,7 +1105,7 @@ static int etm4_probe(struct amba_device *adev, const struct amba_id *id)
 
        spin_lock_init(&drvdata->spinlock);
 
-       drvdata->cpu = pdata ? pdata->cpu : 0;
+       drvdata->cpu = coresight_get_cpu(dev);
 
        cpus_read_lock();
        etmdrvdata[drvdata->cpu] = drvdata;
index ba8c146..541e500 100644 (file)
@@ -325,7 +325,6 @@ coresight_get_platform_data(struct device *dev)
 
        /* Use device name as sysfs handle */
        pdata->name = dev_name(dev);
-       pdata->cpu = coresight_get_cpu(dev);
 
        if (is_of_node(fwnode))
                ret = of_get_coresight_platform_data(dev, pdata);
index 98a4440..bf241db 100644 (file)
@@ -91,14 +91,12 @@ union coresight_dev_subtype {
 
 /**
  * struct coresight_platform_data - data harvested from the DT specification
- * @cpu:       the CPU a source belongs to. Only applicable for ETM/PTMs.
  * @name:      name of the component as shown under sysfs.
  * @nr_inport: number of input ports for this component.
  * @nr_outport:        number of output ports for this component.
  * @conns:     Array of nr_outport connections from this component
  */
 struct coresight_platform_data {
-       int cpu;
        const char *name;
        int nr_inport;
        int nr_outport;