[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJ9a7VjdF0a_5gswt5j+LX9_pxK40ODNpYiYUSmYfsWZYA+Wjg@mail.gmail.com>
Date: Fri, 18 Jul 2025 13:59:03 +0100
From: Mike Leach <mike.leach@...aro.org>
To: Alireza Sanaee <alireza.sanaee@...wei.com>
Cc: devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
jonathan.cameron@...wei.com, coresight@...ts.linaro.org,
dianders@...omium.org, james.clark@...aro.org, krzk@...nel.org,
linux-arm-kernel@...ts.infradead.org, linux-perf-users@...r.kernel.org,
linuxarm@...wei.com, mark.rutland@....com, robh@...nel.org,
ruanjinjie@...wei.com, saravanak@...gle.com,
shameerali.kolothum.thodi@...wei.com, suzuki.poulose@....com
Subject: Re: [PATCH v3 5/6] coresight: Use of_cpu_phandle_to_id for grabbing
CPU ID
On Fri, 18 Jul 2025 at 10:51, Alireza Sanaee <alireza.sanaee@...wei.com> wrote:
>
> Use the newly created API (of_cpu_phandle_to_id) to grab CPU ID.
>
> Reviewed-by: Jonathan Cameron <jonathan.cameron@...wei.com>
> Signed-off-by: Alireza Sanaee <alireza.sanaee@...wei.com>
> ---
> drivers/hwtracing/coresight/coresight-platform.c | 15 +--------------
> 1 file changed, 1 insertion(+), 14 deletions(-)
>
> diff --git a/drivers/hwtracing/coresight/coresight-platform.c b/drivers/hwtracing/coresight/coresight-platform.c
> index 0db64c5f4995..95d46ea08936 100644
> --- a/drivers/hwtracing/coresight/coresight-platform.c
> +++ b/drivers/hwtracing/coresight/coresight-platform.c
> @@ -167,20 +167,7 @@ of_coresight_get_output_ports_node(const struct device_node *node)
>
> static int of_coresight_get_cpu(struct device *dev)
> {
> - int cpu;
> - struct device_node *dn;
> -
> - if (!dev->of_node)
> - return -ENODEV;
> -
> - dn = of_parse_phandle(dev->of_node, "cpu", 0);
> - if (!dn)
> - return -ENODEV;
> -
> - cpu = of_cpu_node_to_id(dn);
> - of_node_put(dn);
> -
> - return cpu;
> + return of_cpu_phandle_to_id(dev->of_node, NULL, 0);
> }
>
> /*
> --
> 2.43.0
>
Reviewed-by: Mike Leach <mike.leach@...aro.org>
--
Mike Leach
Principal Engineer, ARM Ltd.
Manchester Design Centre. UK
Powered by blists - more mailing lists