return 0;
}
-/* coresight_remove_conns - Remove other device's references to this device */
static void coresight_remove_conns(struct coresight_device *csdev)
{
int i, j;
bus_for_each_dev(&coresight_bustype, NULL, csdev,
coresight_clear_filter_source);
- /*
- * Remove the input connection references from the destination device
- * for each output connection.
- */
for (i = 0; i < csdev->pdata->nr_outconns; i++) {
conn = csdev->pdata->out_conns[i];
if (conn->filter_src_fwnode) {
if (!conn->dest_dev)
continue;
+ /* Remove sysfs links for the output connection */
+ coresight_remove_links(csdev, conn);
+
+ /*
+ * Remove the input connection references from the destination
+ * device for each output connection.
+ */
for (j = 0; j < conn->dest_dev->pdata->nr_inconns; ++j)
if (conn->dest_dev->pdata->in_conns[j] == conn) {
conn->dest_dev->pdata->in_conns[j] = NULL;
struct coresight_connection **conns = pdata->out_conns;
for (i = 0; i < pdata->nr_outconns; i++) {
- /* If we have made the links, remove them now */
- 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
}
err_out:
- /* Cleanup the connection information */
coresight_release_platform_data(NULL, desc->dev, desc->pdata);
return ERR_PTR(ret);
}