of: Compare property names by of_prop_cmp() in of_alias_scan()

For these pseudo property names 'name', 'phandle' and 'linux,phandle':

Use dedicated property name comparison macro of_prop_cmp() instead of
strcmp() in of_alias_scan() to:

- Make property name comparison consistent.
- Prepare for introducing private is_pseudo_property() later.

Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com>
Link: https://lore.kernel.org/r/20250224-of_bugfix-v1-1-03640ae8c3a6@quicinc.com
Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
pull/1188/head
Zijun Hu 2025-02-24 22:27:57 +08:00 committed by Rob Herring (Arm)
parent a46a080563
commit 56d733bb8f
1 changed files with 3 additions and 3 deletions

View File

@ -1855,9 +1855,9 @@ void of_alias_scan(void * (*dt_alloc)(u64 size, u64 align))
int id, len;
/* Skip those we do not want to proceed */
if (!strcmp(pp->name, "name") ||
!strcmp(pp->name, "phandle") ||
!strcmp(pp->name, "linux,phandle"))
if (!of_prop_cmp(pp->name, "name") ||
!of_prop_cmp(pp->name, "phandle") ||
!of_prop_cmp(pp->name, "linux,phandle"))
continue;
np = of_find_node_by_path(pp->value);