Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 22083ca3 authored by Rama Aparna Mallavarapu's avatar Rama Aparna Mallavarapu
Browse files

Coresight: add support for device names



Add support to read device names from device tree entries.
This allows using same names for CoreSight devices across different
targets.

Change-Id: Ide3da74533051db38e9a6c5904a7cab42b3be6c1
Signed-off-by: default avatarShashank Mittal <mittals@codeaurora.org>
Signed-off-by: default avatarRama Aparna Mallavarapu <aparnam@codeaurora.org>
parent db56f429
Loading
Loading
Loading
Loading
+10 −5
Original line number Diff line number Diff line
/* Copyright (c) 2012, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012, 2017 The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -143,9 +143,11 @@ of_get_coresight_platform_data(struct device *dev,
	if (!pdata)
		return ERR_PTR(-ENOMEM);

	ret = of_property_read_string(node, "coresight-name", &pdata->name);
	if (ret) {
		/* Use device name as sysfs handle */
		pdata->name = dev_name(dev);

	}
	/* Get the number of input and output port for this component */
	of_coresight_get_ports(node, &pdata->nr_inport, &pdata->nr_outport);

@@ -194,6 +196,9 @@ of_get_coresight_platform_data(struct device *dev,
			if (!rdev)
				return ERR_PTR(-EPROBE_DEFER);

			ret = of_property_read_string(rparent, "coresight-name",
						&pdata->child_names[i]);
			if (ret)
				pdata->child_names[i] = dev_name(rdev);
			pdata->child_ports[i] = rendpoint.id;