[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250502161300.1411-4-alireza.sanaee@huawei.com>
Date: Fri, 2 May 2025 17:12:57 +0100
From: Alireza Sanaee <alireza.sanaee@...wei.com>
To: <devicetree@...r.kernel.org>
CC: <robh@...nel.org>, <jonathan.cameron@...wei.com>,
<linux-arm-kernel@...ts.infradead.org>, <linux-kernel@...r.kernel.org>,
<linuxarm@...wei.com>, <mark.rutland@....com>,
<shameerali.kolothum.thodi@...wei.com>
Subject: [PATCH v2 3/6] coresight: cti: Use of_cpu_phandle_to_id for grabbing CPU id
Use the newly created API to grab CPU id.
Signed-off-by: Alireza Sanaee <alireza.sanaee@...wei.com>
---
.../hwtracing/coresight/coresight-cti-platform.c | 15 +++------------
1 file changed, 3 insertions(+), 12 deletions(-)
diff --git a/drivers/hwtracing/coresight/coresight-cti-platform.c b/drivers/hwtracing/coresight/coresight-cti-platform.c
index d0ae10bf6128..369a9b7170e8 100644
--- a/drivers/hwtracing/coresight/coresight-cti-platform.c
+++ b/drivers/hwtracing/coresight/coresight-cti-platform.c
@@ -41,21 +41,12 @@
*/
static int of_cti_get_cpu_at_node(const struct device_node *node)
{
+ struct device_node *dn = NULL;
int cpu;
- struct device_node *dn;
- if (node == NULL)
- return -1;
-
- dn = of_parse_phandle(node, "cpu", 0);
- /* CTI affinity defaults to no cpu */
- if (!dn)
- return -1;
- cpu = of_cpu_node_to_id(dn);
+ cpu = of_cpu_phandle_to_id(node, &dn);
of_node_put(dn);
-
- /* No Affinity if no cpu nodes are found */
- return (cpu < 0) ? -1 : cpu;
+ return cpu;
}
#else
--
2.34.1
Powered by blists - more mailing lists