Add support to read device names from device tree entries. Before the previous process of allocating coresight device name, try to read the coresight device name from device tree entries. If it is read, the device name will be returned directly. If it is not read, the original allocation name process will be followed.
Signed-off-by: Tingwei Zhang tingwei@codeaurora.org Signed-off-by: Tao Zhang taozha@codeaurora.org --- drivers/hwtracing/coresight/coresight-core.c | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/drivers/hwtracing/coresight/coresight-core.c b/drivers/hwtracing/coresight/coresight-core.c index 4ba801d..b79c726 100644 --- a/drivers/hwtracing/coresight/coresight-core.c +++ b/drivers/hwtracing/coresight/coresight-core.c @@ -1640,6 +1640,12 @@ char *coresight_alloc_device_name(struct coresight_dev_list *dict, int idx; char *name = NULL; struct fwnode_handle **list; + struct device_node *node = dev->of_node; + + if (!node) { + if (!of_property_read_string(node, "coresight-name", &name)) + return name; + }
mutex_lock(&coresight_mutex);