Re: [PATCH v3 1/6] of: add infra for finding CPU id from phandle
From: Jonathan Cameron
Date: Fri Jul 18 2025 - 07:10:57 EST
On Fri, 18 Jul 2025 10:48:43 +0100
Alireza Sanaee <alireza.sanaee@xxxxxxxxxx> wrote:
> Get CPU ID from phandle. Some drivers such as coresight, cti-coresight,
> or arm-dsu use this API for finding CPU node in DT. In particular,
> drivers do this by getting the CPU device_node through a phandle and
> then find the CPU ID using of_cpu_node_to_id(). This commit encapsulates
> CPU node finding and improves readability.
>
> The API interface takes three parameters, 1) node, 2) pointer to
> pointer of CPU node, 3) CPU node index. API sets the pointer to the CPU
> node and allows the driver to work with the CPU node, for logging
> purposes for instance.
>
> Signed-off-by: Alireza Sanaee <alireza.sanaee@xxxxxxxxxx>
Reviewed-by: Jonathan Cameron <jonathan.cameron@xxxxxxxxxx>