of/fdt: Consolidate duplicate code into helper functions

[ Upstream commit 8278cb72c6 ]

Currently, there are many pieces of nearly identical code scattered across
different places. Consolidate the duplicate code into helper functions to
improve maintainability and reduce the likelihood of errors.

Signed-off-by: Yuntao Wang <yuntao.wang@linux.dev>
Link: https://patch.msgid.link/20251115134753.179931-2-yuntao.wang@linux.dev
Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
Stable-dep-of: bec5f6092b ("of/fdt: Fix the len check in early_init_dt_check_for_elfcorehdr()")
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Yuntao Wang 2025-11-15 21:47:46 +08:00 • committed by Greg Kroah-Hartman
commit 7045d5970e
2 changed files with 50 additions and 0 deletions