[PATCH v3 1/6] of: add infra for finding CPU id from phandle

Jonathan Cameron Jonathan.Cameron at huawei.com
Fri Jul 18 04:10:42 PDT 2025


On Fri, 18 Jul 2025 10:48:43 +0100
Alireza Sanaee <alireza.sanaee at huawei.com> 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 at huawei.com>

Reviewed-by: Jonathan Cameron <jonathan.cameron at huawei.com>



More information about the linux-arm-kernel mailing list