Re: [PATCH 18/25] coresight: Introduce generic platform data helper

From: Suzuki K Poulose
Date: Thu Mar 28 2019 - 06:57:47 EST


On 03/27/2019 10:57 PM, Mathieu Poirier wrote:
On Wed, Mar 20, 2019 at 06:49:35PM +0000, Suzuki K Poulose wrote:
So far we have hard coded the DT platform parsing code in
every driver. Introduce generic helper to parse the information
provided by the firmware in a platform agnostic manner, in preparation
for the ACPI support.

Cc: Mathieu Poirier <mathieu.poirier@xxxxxxxxxx>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@xxxxxxx>


+static int coresight_alloc_conns(struct device *dev,
+ struct coresight_platform_data *pdata)
+{
+ if (pdata->nr_outport) {
+ pdata->conns = devm_kzalloc(dev, pdata->nr_outport *
+ sizeof(*pdata->conns),
+ GFP_KERNEL);
+ if (!pdata->conns)
+ return -ENOMEM;
+ }
+
+ return 0;
+}
+

- ret = of_coresight_alloc_memory(dev, pdata);
+ ret = coresight_alloc_conns(dev, pdata);

I'm pretty sure you're doing this because you want to use
coresight_alloc_conns() for ACPI as well, and I'm fine with that. But it is
quite orthogonal to the rest of the work done in this patch and as such I think
it needs a patch of its own.


Sure, will split this into a separate patch.

Suzuki