Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

firmware: qcom: scm: Simplify with of_machine_device_match()

Replace open-coded getting root OF node and matching against it with
new of_machine_device_match() helper.

Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Tested-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://patch.msgid.link/20251112-b4-of-match-matchine-data-v2-6-d46b72003fd6@linaro.org
Signed-off-by: Rob Herring (Arm) <robh@kernel.org>

authored by

Krzysztof Kozlowski and committed by
Rob Herring (Arm)
f83b4270 4b94d21f

+1 -16
+1 -16
drivers/firmware/qcom/qcom_scm.c
··· 2018 2018 { } 2019 2019 }; 2020 2020 2021 - static bool qcom_scm_qseecom_machine_is_allowed(void) 2022 - { 2023 - struct device_node *np; 2024 - bool match; 2025 - 2026 - np = of_find_node_by_path("/"); 2027 - if (!np) 2028 - return false; 2029 - 2030 - match = of_match_node(qcom_scm_qseecom_allowlist, np); 2031 - of_node_put(np); 2032 - 2033 - return match; 2034 - } 2035 - 2036 2021 static void qcom_scm_qseecom_free(void *data) 2037 2022 { 2038 2023 struct platform_device *qseecom_dev = data; ··· 2049 2064 2050 2065 dev_info(scm->dev, "qseecom: found qseecom with version 0x%x\n", version); 2051 2066 2052 - if (!qcom_scm_qseecom_machine_is_allowed()) { 2067 + if (!of_machine_device_match(qcom_scm_qseecom_allowlist)) { 2053 2068 dev_info(scm->dev, "qseecom: untested machine, skipping\n"); 2054 2069 return 0; 2055 2070 }