|
@@ -321,6 +321,21 @@ err:
|
|
|
goto out;
|
|
|
}
|
|
|
|
|
|
+struct coresight_device *coresight_get_sink(struct list_head *path)
|
|
|
+{
|
|
|
+ struct coresight_device *csdev;
|
|
|
+
|
|
|
+ if (!path)
|
|
|
+ return NULL;
|
|
|
+
|
|
|
+ csdev = list_last_entry(path, struct coresight_node, link)->csdev;
|
|
|
+ if (csdev->type != CORESIGHT_DEV_TYPE_SINK &&
|
|
|
+ csdev->type != CORESIGHT_DEV_TYPE_LINKSINK)
|
|
|
+ return NULL;
|
|
|
+
|
|
|
+ return csdev;
|
|
|
+}
|
|
|
+
|
|
|
/**
|
|
|
* _coresight_build_path - recursively build a path from a @csdev to a sink.
|
|
|
* @csdev: The device to start from.
|