wlan-ap-Telecominfraproject/feeds/qca-wifi-7/ipq53xx/patches-6.1/0414-coresight-fetch-device-name-for-the-sysfs-from-DTS.patch
John Crispin 68cf54d9f7 qca-wifi-7: update to ath12.5.5
Signed-off-by: John Crispin <john@phrozen.org>
2025-02-27 12:45:52 +01:00

100 lines
4.2 KiB
Diff

From e9f1cd5dc5d6d0cc5ef50ae54ff0e5949bd65944 Mon Sep 17 00:00:00 2001
From: Sridharan S N <quic_sridsn@quicinc.com>
Date: Wed, 16 Aug 2023 15:41:16 +0530
Subject: [PATCH] coresight: fetch device name for the sysfs from DTS
fetch the device name from the device tree if its available and use the same
Change-Id: I9cddee9116a2bb4d7f583880ef99bc22191559b9
Signed-off-by: Sridharan S N <quic_sridsn@quicinc.com>
---
drivers/hwtracing/coresight/coresight-etm4x-core.c | 4 +++-
drivers/hwtracing/coresight/coresight-funnel.c | 3 ++-
drivers/hwtracing/coresight/coresight-replicator.c | 3 ++-
drivers/hwtracing/coresight/coresight-stm.c | 3 ++-
drivers/hwtracing/coresight/coresight-tmc-core.c | 4 ++--
5 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/drivers/hwtracing/coresight/coresight-etm4x-core.c b/drivers/hwtracing/coresight/coresight-etm4x-core.c
index 1cf7478da6ee..0aadf47941a4 100644
--- a/drivers/hwtracing/coresight/coresight-etm4x-core.c
+++ b/drivers/hwtracing/coresight/coresight-etm4x-core.c
@@ -30,6 +30,7 @@
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux/property.h>
+#include <linux/of.h>
#include <asm/barrier.h>
#include <asm/sections.h>
@@ -1968,7 +1969,8 @@ static int etm4_probe(struct device *dev, void __iomem *base, u32 etm_pid)
type_name = "etm";
}
- desc.name = devm_kasprintf(dev, GFP_KERNEL,
+ if (of_property_read_string(dev->of_node, "coresight-name", &desc.name))
+ desc.name = devm_kasprintf(dev, GFP_KERNEL,
"%s%d", type_name, drvdata->cpu);
if (!desc.name)
return -ENOMEM;
diff --git a/drivers/hwtracing/coresight/coresight-funnel.c b/drivers/hwtracing/coresight/coresight-funnel.c
index b363dd6bc510..6798d62912f6 100644
--- a/drivers/hwtracing/coresight/coresight-funnel.c
+++ b/drivers/hwtracing/coresight/coresight-funnel.c
@@ -217,7 +217,8 @@ static int funnel_probe(struct device *dev, struct resource *res)
of_device_is_compatible(dev->of_node, "arm,coresight-funnel"))
dev_warn_once(dev, "Uses OBSOLETE CoreSight funnel binding\n");
- desc.name = coresight_alloc_device_name(&funnel_devs, dev);
+ if (of_property_read_string(dev->of_node, "coresight-name", &desc.name))
+ desc.name = coresight_alloc_device_name(&funnel_devs, dev);
if (!desc.name)
return -ENOMEM;
diff --git a/drivers/hwtracing/coresight/coresight-replicator.c b/drivers/hwtracing/coresight/coresight-replicator.c
index 4dd50546d7e4..458c5099b511 100644
--- a/drivers/hwtracing/coresight/coresight-replicator.c
+++ b/drivers/hwtracing/coresight/coresight-replicator.c
@@ -225,7 +225,8 @@ static int replicator_probe(struct device *dev, struct resource *res)
dev_warn_once(dev,
"Uses OBSOLETE CoreSight replicator binding\n");
- desc.name = coresight_alloc_device_name(&replicator_devs, dev);
+ if (of_property_read_string(dev->of_node, "coresight-name", &desc.name))
+ desc.name = coresight_alloc_device_name(&replicator_devs, dev);
if (!desc.name)
return -ENOMEM;
diff --git a/drivers/hwtracing/coresight/coresight-stm.c b/drivers/hwtracing/coresight/coresight-stm.c
index 463f449cfb79..398ef090d5bf 100644
--- a/drivers/hwtracing/coresight/coresight-stm.c
+++ b/drivers/hwtracing/coresight/coresight-stm.c
@@ -847,7 +847,8 @@ static int stm_probe(struct amba_device *adev, const struct amba_id *id)
struct resource ch_res;
struct coresight_desc desc = { 0 };
- desc.name = coresight_alloc_device_name(&stm_devs, dev);
+ if (of_property_read_string(dev->of_node, "coresight-name", &desc.name))
+ desc.name = coresight_alloc_device_name(&stm_devs, dev);
if (!desc.name)
return -ENOMEM;
diff --git a/drivers/hwtracing/coresight/coresight-tmc-core.c b/drivers/hwtracing/coresight/coresight-tmc-core.c
index 07abf28ad725..e70f5135050f 100644
--- a/drivers/hwtracing/coresight/coresight-tmc-core.c
+++ b/drivers/hwtracing/coresight/coresight-tmc-core.c
@@ -505,8 +505,8 @@ static int tmc_probe(struct amba_device *adev, const struct amba_id *id)
ret = -EINVAL;
goto out;
}
-
- desc.name = coresight_alloc_device_name(dev_list, dev);
+ if (of_property_read_string(dev->of_node, "coresight-name", &desc.name))
+ desc.name = coresight_alloc_device_name(dev_list, dev);
if (!desc.name) {
ret = -ENOMEM;
goto out;
--
2.34.1