for (i = 0; i < parent->pdata->nr_outconns; i++) {
conn = &parent->pdata->out_conns[i];
- if (conn->child_dev == csdev)
- return conn->child_port;
+ if (conn->dest_dev == csdev)
+ return conn->dest_port;
}
dev_err(&csdev->dev, "couldn't find inport, parent: %s, child: %s\n",
for (i = 0; i < csdev->pdata->nr_outconns; i++) {
conn = &csdev->pdata->out_conns[i];
- if (conn->child_dev == child)
- return conn->outport;
+ if (conn->dest_dev == child)
+ return conn->src_port;
}
dev_err(&csdev->dev, "couldn't find outport, parent: %s, child: %s\n",
for (i = 0; i < csdev->pdata->nr_outconns; i++) {
struct coresight_device *child_dev;
- child_dev = csdev->pdata->out_conns[i].child_dev;
+ child_dev = csdev->pdata->out_conns[i].dest_dev;
if (child_dev)
sink = coresight_find_enabled_sink(child_dev);
if (sink)
for (i = 0; i < csdev->pdata->nr_outconns; i++) {
struct coresight_device *child;
- child = csdev->pdata->out_conns[i].child_dev;
+ child = csdev->pdata->out_conns[i].dest_dev;
if (child && child->type == CORESIGHT_DEV_TYPE_HELPER)
if (!coresight_get_ref(child))
goto err;
for (i--; i >= 0; i--) {
struct coresight_device *child;
- child = csdev->pdata->out_conns[i].child_dev;
+ child = csdev->pdata->out_conns[i].dest_dev;
if (child && child->type == CORESIGHT_DEV_TYPE_HELPER)
coresight_put_ref(child);
}
for (i = 0; i < csdev->pdata->nr_outconns; i++) {
struct coresight_device *child;
- child = csdev->pdata->out_conns[i].child_dev;
+ child = csdev->pdata->out_conns[i].dest_dev;
if (child && child->type == CORESIGHT_DEV_TYPE_HELPER)
coresight_put_ref(child);
}
for (i = 0; i < csdev->pdata->nr_outconns; i++) {
struct coresight_device *child_dev;
- child_dev = csdev->pdata->out_conns[i].child_dev;
+ child_dev = csdev->pdata->out_conns[i].dest_dev;
if (child_dev &&
_coresight_build_path(child_dev, sink, path) == 0) {
found = true;
struct coresight_device *child_dev, *sink = NULL;
int child_depth = curr_depth;
- child_dev = csdev->pdata->out_conns[i].child_dev;
+ child_dev = csdev->pdata->out_conns[i].dest_dev;
if (child_dev)
sink = coresight_find_sink(child_dev, &child_depth);
conn = &i_csdev->pdata->out_conns[i];
/* Skip the port if FW doesn't describe it */
- if (!conn->child_fwnode)
+ if (!conn->dest_fwnode)
continue;
/* We have found at least one orphan connection */
- if (conn->child_dev == NULL) {
+ if (conn->dest_dev == NULL) {
/* Does it match this newly added device? */
- if (conn->child_fwnode == csdev->dev.fwnode) {
+ if (conn->dest_fwnode == csdev->dev.fwnode) {
ret = coresight_make_links(i_csdev,
conn, csdev);
if (ret)
for (i = 0; i < csdev->pdata->nr_outconns; i++) {
struct coresight_connection *conn = &csdev->pdata->out_conns[i];
- if (!conn->child_fwnode)
+ if (!conn->dest_fwnode)
continue;
- conn->child_dev =
- coresight_find_csdev_by_fwnode(conn->child_fwnode);
- if (conn->child_dev && conn->child_dev->has_conns_grp) {
- ret = coresight_make_links(csdev, conn,
- conn->child_dev);
+ conn->dest_dev =
+ coresight_find_csdev_by_fwnode(conn->dest_fwnode);
+ if (conn->dest_dev && conn->dest_dev->has_conns_grp) {
+ ret = coresight_make_links(csdev, conn, conn->dest_dev);
if (ret)
break;
} else {
for (i = 0; i < iterator->pdata->nr_outconns; i++) {
conn = &iterator->pdata->out_conns[i];
- if (conn->child_dev == NULL || conn->child_fwnode == NULL)
+ if (conn->dest_dev == NULL || conn->dest_fwnode == NULL)
continue;
- if (csdev->dev.fwnode == conn->child_fwnode) {
+ if (csdev->dev.fwnode == conn->dest_fwnode) {
iterator->orphan = true;
coresight_remove_links(iterator, conn);
- conn->child_dev = NULL;
+ conn->dest_dev = NULL;
/* No need to continue */
break;
}
for (i = 0; i < pdata->nr_outconns; i++) {
/* If we have made the links, remove them now */
- if (csdev && conns[i].child_dev)
+ if (csdev && conns[i].dest_dev)
coresight_remove_links(csdev, &conns[i]);
/*
* Drop the refcount and clear the handle as this device
* is going away
*/
- if (conns[i].child_fwnode) {
- fwnode_handle_put(conns[i].child_fwnode);
- conns[i].child_fwnode = NULL;
+ if (conns[i].dest_fwnode) {
+ fwnode_handle_put(conns[i].dest_fwnode);
+ conns[i].dest_fwnode = NULL;
}
}
if (csdev)
}
conn = &pdata->out_conns[endpoint.port];
- if (conn->child_fwnode) {
+ if (conn->dest_fwnode) {
dev_warn(dev, "Duplicate output port %d\n",
endpoint.port);
ret = -EINVAL;
break;
}
- conn->outport = endpoint.port;
+ conn->src_port = endpoint.port;
/*
* Hold the refcount to the target device. This could be
* released via:
* 2) While removing the target device via
* coresight_remove_match()
*/
- conn->child_fwnode = fwnode_handle_get(rdev_fwnode);
- conn->child_port = rendpoint.port;
+ conn->dest_fwnode = fwnode_handle_get(rdev_fwnode);
+ conn->dest_port = rendpoint.port;
/* Connection record updated */
} while (0);
dir = fields[3].integer.value;
if (dir == ACPI_CORESIGHT_LINK_MASTER) {
- conn->outport = fields[0].integer.value;
- conn->child_port = fields[1].integer.value;
+ conn->src_port = fields[0].integer.value;
+ conn->dest_port = fields[1].integer.value;
rdev = coresight_find_device_by_fwnode(&r_adev->fwnode);
if (!rdev)
return -EPROBE_DEFER;
* 2) While removing the target device via
* coresight_remove_match().
*/
- conn->child_fwnode = fwnode_handle_get(&r_adev->fwnode);
+ conn->dest_fwnode = fwnode_handle_get(&r_adev->fwnode);
} else if (dir == ACPI_CORESIGHT_LINK_SLAVE) {
/*
* We are only interested in the port number
* for the input ports at this component.
* Store the port number in child_port.
*/
- conn->child_port = fields[0].integer.value;
+ conn->dest_port = fields[0].integer.value;
} else {
/* Invalid direction */
return -EINVAL;
return dir;
if (dir == ACPI_CORESIGHT_LINK_MASTER) {
- if (ptr->outport >= pdata->nr_outconns)
- pdata->nr_outconns = ptr->outport + 1;
+ if (ptr->src_port >= pdata->nr_outconns)
+ pdata->nr_outconns = ptr->src_port + 1;
ptr++;
} else {
- WARN_ON(pdata->nr_inconns == ptr->child_port + 1);
+ WARN_ON(pdata->nr_inconns == ptr->dest_port + 1);
/*
* We do not track input port connections for a device.
* However we need the highest port number described,
* record for an output connection. Hence, do not move
* the ptr for input connections
*/
- if (ptr->child_port >= pdata->nr_inconns)
- pdata->nr_inconns = ptr->child_port + 1;
+ if (ptr->dest_port >= pdata->nr_inconns)
+ pdata->nr_inconns = ptr->dest_port + 1;
}
}
/* Copy the connection information to the final location */
for (i = 0; conns + i < ptr; i++) {
- int port = conns[i].outport;
+ int port = conns[i].src_port;
/* Duplicate output port */
- WARN_ON(pdata->out_conns[port].child_fwnode);
+ WARN_ON(pdata->out_conns[port].dest_fwnode);
pdata->out_conns[port] = conns[i];
}
do {
outs = devm_kasprintf(&orig->dev, GFP_KERNEL,
- "out:%d", conn->outport);
+ "out:%d", conn->src_port);
if (!outs)
break;
ins = devm_kasprintf(&target->dev, GFP_KERNEL,
- "in:%d", conn->child_port);
+ "in:%d", conn->dest_port);
if (!ins)
break;
link = devm_kzalloc(&orig->dev,
* Install the device connection. This also indicates that
* the links are operational on both ends.
*/
- conn->child_dev = target;
+ conn->dest_dev = target;
return 0;
} while (0);
coresight_remove_sysfs_link(conn->link);
- devm_kfree(&conn->child_dev->dev, conn->link->target_name);
+ devm_kfree(&conn->dest_dev->dev, conn->link->target_name);
devm_kfree(&orig->dev, conn->link->orig_name);
devm_kfree(&orig->dev, conn->link);
conn->link = NULL;
- conn->child_dev = NULL;
+ conn->dest_dev = NULL;
}