Commit 704faaf4 authored by James Clark's avatar James Clark Committed by Suzuki K Poulose

coresight: Change name of pdata->conns

conns is actually for output connections. Change the name to make it
clearer and so that we can add input connections later.

No functional changes.
Reviewed-by: default avatarMike Leach <mike.leach@linaro.org>
Signed-off-by: default avatarJames Clark <james.clark@arm.com>
Signed-off-by: default avatarSuzuki K Poulose <suzuki.poulose@arm.com>
Link: https://lore.kernel.org/r/20230425143542.2305069-4-james.clark@arm.com
parent 9fa36828
...@@ -119,7 +119,7 @@ static int coresight_find_link_inport(struct coresight_device *csdev, ...@@ -119,7 +119,7 @@ static int coresight_find_link_inport(struct coresight_device *csdev,
struct coresight_connection *conn; struct coresight_connection *conn;
for (i = 0; i < parent->pdata->nr_outport; i++) { for (i = 0; i < parent->pdata->nr_outport; i++) {
conn = &parent->pdata->conns[i]; conn = &parent->pdata->out_conns[i];
if (conn->child_dev == csdev) if (conn->child_dev == csdev)
return conn->child_port; return conn->child_port;
} }
...@@ -137,7 +137,7 @@ static int coresight_find_link_outport(struct coresight_device *csdev, ...@@ -137,7 +137,7 @@ static int coresight_find_link_outport(struct coresight_device *csdev,
struct coresight_connection *conn; struct coresight_connection *conn;
for (i = 0; i < csdev->pdata->nr_outport; i++) { for (i = 0; i < csdev->pdata->nr_outport; i++) {
conn = &csdev->pdata->conns[i]; conn = &csdev->pdata->out_conns[i];
if (conn->child_dev == child) if (conn->child_dev == child)
return conn->outport; return conn->outport;
} }
...@@ -606,7 +606,7 @@ coresight_find_enabled_sink(struct coresight_device *csdev) ...@@ -606,7 +606,7 @@ coresight_find_enabled_sink(struct coresight_device *csdev)
for (i = 0; i < csdev->pdata->nr_outport; i++) { for (i = 0; i < csdev->pdata->nr_outport; i++) {
struct coresight_device *child_dev; struct coresight_device *child_dev;
child_dev = csdev->pdata->conns[i].child_dev; child_dev = csdev->pdata->out_conns[i].child_dev;
if (child_dev) if (child_dev)
sink = coresight_find_enabled_sink(child_dev); sink = coresight_find_enabled_sink(child_dev);
if (sink) if (sink)
...@@ -722,7 +722,7 @@ static int coresight_grab_device(struct coresight_device *csdev) ...@@ -722,7 +722,7 @@ static int coresight_grab_device(struct coresight_device *csdev)
for (i = 0; i < csdev->pdata->nr_outport; i++) { for (i = 0; i < csdev->pdata->nr_outport; i++) {
struct coresight_device *child; struct coresight_device *child;
child = csdev->pdata->conns[i].child_dev; child = csdev->pdata->out_conns[i].child_dev;
if (child && child->type == CORESIGHT_DEV_TYPE_HELPER) if (child && child->type == CORESIGHT_DEV_TYPE_HELPER)
if (!coresight_get_ref(child)) if (!coresight_get_ref(child))
goto err; goto err;
...@@ -733,7 +733,7 @@ static int coresight_grab_device(struct coresight_device *csdev) ...@@ -733,7 +733,7 @@ static int coresight_grab_device(struct coresight_device *csdev)
for (i--; i >= 0; i--) { for (i--; i >= 0; i--) {
struct coresight_device *child; struct coresight_device *child;
child = csdev->pdata->conns[i].child_dev; child = csdev->pdata->out_conns[i].child_dev;
if (child && child->type == CORESIGHT_DEV_TYPE_HELPER) if (child && child->type == CORESIGHT_DEV_TYPE_HELPER)
coresight_put_ref(child); coresight_put_ref(child);
} }
...@@ -752,7 +752,7 @@ static void coresight_drop_device(struct coresight_device *csdev) ...@@ -752,7 +752,7 @@ static void coresight_drop_device(struct coresight_device *csdev)
for (i = 0; i < csdev->pdata->nr_outport; i++) { for (i = 0; i < csdev->pdata->nr_outport; i++) {
struct coresight_device *child; struct coresight_device *child;
child = csdev->pdata->conns[i].child_dev; child = csdev->pdata->out_conns[i].child_dev;
if (child && child->type == CORESIGHT_DEV_TYPE_HELPER) if (child && child->type == CORESIGHT_DEV_TYPE_HELPER)
coresight_put_ref(child); coresight_put_ref(child);
} }
...@@ -794,7 +794,7 @@ static int _coresight_build_path(struct coresight_device *csdev, ...@@ -794,7 +794,7 @@ static int _coresight_build_path(struct coresight_device *csdev,
for (i = 0; i < csdev->pdata->nr_outport; i++) { for (i = 0; i < csdev->pdata->nr_outport; i++) {
struct coresight_device *child_dev; struct coresight_device *child_dev;
child_dev = csdev->pdata->conns[i].child_dev; child_dev = csdev->pdata->out_conns[i].child_dev;
if (child_dev && if (child_dev &&
_coresight_build_path(child_dev, sink, path) == 0) { _coresight_build_path(child_dev, sink, path) == 0) {
found = true; found = true;
...@@ -964,7 +964,7 @@ coresight_find_sink(struct coresight_device *csdev, int *depth) ...@@ -964,7 +964,7 @@ coresight_find_sink(struct coresight_device *csdev, int *depth)
struct coresight_device *child_dev, *sink = NULL; struct coresight_device *child_dev, *sink = NULL;
int child_depth = curr_depth; int child_depth = curr_depth;
child_dev = csdev->pdata->conns[i].child_dev; child_dev = csdev->pdata->out_conns[i].child_dev;
if (child_dev) if (child_dev)
sink = coresight_find_sink(child_dev, &child_depth); sink = coresight_find_sink(child_dev, &child_depth);
...@@ -1334,7 +1334,7 @@ static int coresight_orphan_match(struct device *dev, void *data) ...@@ -1334,7 +1334,7 @@ static int coresight_orphan_match(struct device *dev, void *data)
* an orphan connection whose name matches @csdev, link it. * an orphan connection whose name matches @csdev, link it.
*/ */
for (i = 0; i < i_csdev->pdata->nr_outport; i++) { for (i = 0; i < i_csdev->pdata->nr_outport; i++) {
conn = &i_csdev->pdata->conns[i]; conn = &i_csdev->pdata->out_conns[i];
/* Skip the port if FW doesn't describe it */ /* Skip the port if FW doesn't describe it */
if (!conn->child_fwnode) if (!conn->child_fwnode)
...@@ -1375,7 +1375,7 @@ static int coresight_fixup_device_conns(struct coresight_device *csdev) ...@@ -1375,7 +1375,7 @@ static int coresight_fixup_device_conns(struct coresight_device *csdev)
int i, ret = 0; int i, ret = 0;
for (i = 0; i < csdev->pdata->nr_outport; i++) { for (i = 0; i < csdev->pdata->nr_outport; i++) {
struct coresight_connection *conn = &csdev->pdata->conns[i]; struct coresight_connection *conn = &csdev->pdata->out_conns[i];
if (!conn->child_fwnode) if (!conn->child_fwnode)
continue; continue;
...@@ -1412,7 +1412,7 @@ static int coresight_remove_match(struct device *dev, void *data) ...@@ -1412,7 +1412,7 @@ static int coresight_remove_match(struct device *dev, void *data)
* a connection whose name matches @csdev, remove it. * a connection whose name matches @csdev, remove it.
*/ */
for (i = 0; i < iterator->pdata->nr_outport; i++) { for (i = 0; i < iterator->pdata->nr_outport; i++) {
conn = &iterator->pdata->conns[i]; conn = &iterator->pdata->out_conns[i];
if (conn->child_dev == NULL || conn->child_fwnode == NULL) if (conn->child_dev == NULL || conn->child_fwnode == NULL)
continue; continue;
...@@ -1543,7 +1543,7 @@ void coresight_release_platform_data(struct coresight_device *csdev, ...@@ -1543,7 +1543,7 @@ void coresight_release_platform_data(struct coresight_device *csdev,
struct coresight_platform_data *pdata) struct coresight_platform_data *pdata)
{ {
int i; int i;
struct coresight_connection *conns = pdata->conns; struct coresight_connection *conns = pdata->out_conns;
for (i = 0; i < pdata->nr_outport; i++) { for (i = 0; i < pdata->nr_outport; i++) {
/* If we have made the links, remove them now */ /* If we have made the links, remove them now */
...@@ -1555,7 +1555,7 @@ void coresight_release_platform_data(struct coresight_device *csdev, ...@@ -1555,7 +1555,7 @@ void coresight_release_platform_data(struct coresight_device *csdev,
*/ */
if (conns[i].child_fwnode) { if (conns[i].child_fwnode) {
fwnode_handle_put(conns[i].child_fwnode); fwnode_handle_put(conns[i].child_fwnode);
pdata->conns[i].child_fwnode = NULL; conns[i].child_fwnode = NULL;
} }
} }
if (csdev) if (csdev)
......
...@@ -27,9 +27,9 @@ static int coresight_alloc_conns(struct device *dev, ...@@ -27,9 +27,9 @@ static int coresight_alloc_conns(struct device *dev,
struct coresight_platform_data *pdata) struct coresight_platform_data *pdata)
{ {
if (pdata->nr_outport) { if (pdata->nr_outport) {
pdata->conns = devm_kcalloc(dev, pdata->nr_outport, pdata->out_conns = devm_kcalloc(dev, pdata->nr_outport,
sizeof(*pdata->conns), GFP_KERNEL); sizeof(*pdata->out_conns), GFP_KERNEL);
if (!pdata->conns) if (!pdata->out_conns)
return -ENOMEM; return -ENOMEM;
} }
...@@ -251,7 +251,7 @@ static int of_coresight_parse_endpoint(struct device *dev, ...@@ -251,7 +251,7 @@ static int of_coresight_parse_endpoint(struct device *dev,
break; break;
} }
conn = &pdata->conns[endpoint.port]; conn = &pdata->out_conns[endpoint.port];
if (conn->child_fwnode) { if (conn->child_fwnode) {
dev_warn(dev, "Duplicate output port %d\n", dev_warn(dev, "Duplicate output port %d\n",
endpoint.port); endpoint.port);
...@@ -744,8 +744,8 @@ static int acpi_coresight_parse_graph(struct acpi_device *adev, ...@@ -744,8 +744,8 @@ static int acpi_coresight_parse_graph(struct acpi_device *adev,
int port = conns[i].outport; int port = conns[i].outport;
/* Duplicate output port */ /* Duplicate output port */
WARN_ON(pdata->conns[port].child_fwnode); WARN_ON(pdata->out_conns[port].child_fwnode);
pdata->conns[port] = conns[i]; pdata->out_conns[port] = conns[i];
} }
devm_kfree(&adev->dev, conns); devm_kfree(&adev->dev, conns);
......
...@@ -782,7 +782,7 @@ tmc_etr_get_catu_device(struct tmc_drvdata *drvdata) ...@@ -782,7 +782,7 @@ tmc_etr_get_catu_device(struct tmc_drvdata *drvdata)
return NULL; return NULL;
for (i = 0; i < etr->pdata->nr_outport; i++) { for (i = 0; i < etr->pdata->nr_outport; i++) {
tmp = etr->pdata->conns[i].child_dev; tmp = etr->pdata->out_conns[i].child_dev;
if (tmp && coresight_is_catu_device(tmp)) if (tmp && coresight_is_catu_device(tmp))
return tmp; return tmp;
} }
......
...@@ -104,12 +104,12 @@ union coresight_dev_subtype { ...@@ -104,12 +104,12 @@ union coresight_dev_subtype {
* *
* @nr_inport: Number of elements for the input connections. * @nr_inport: Number of elements for the input connections.
* @nr_outport: Number of elements for the output connections. * @nr_outport: Number of elements for the output connections.
* @conns: Sparse array of nr_outport connections from this component. * @out_conns: Sparse array of nr_outport connections from this component.
*/ */
struct coresight_platform_data { struct coresight_platform_data {
int nr_inport; int nr_inport;
int nr_outport; int nr_outport;
struct coresight_connection *conns; struct coresight_connection *out_conns;
}; };
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment