Skip to content

Commit f83b427

Browse files
krzkrobherring
authored andcommitted
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>
1 parent 4b94d21 commit f83b427

1 file changed

Lines changed: 1 addition & 16 deletions

File tree

drivers/firmware/qcom/qcom_scm.c

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2018,21 +2018,6 @@ static const struct of_device_id qcom_scm_qseecom_allowlist[] __maybe_unused = {
20182018
{ }
20192019
};
20202020

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-
20362021
static void qcom_scm_qseecom_free(void *data)
20372022
{
20382023
struct platform_device *qseecom_dev = data;
@@ -2064,7 +2049,7 @@ static int qcom_scm_qseecom_init(struct qcom_scm *scm)
20642049

20652050
dev_info(scm->dev, "qseecom: found qseecom with version 0x%x\n", version);
20662051

2067-
if (!qcom_scm_qseecom_machine_is_allowed()) {
2052+
if (!of_machine_device_match(qcom_scm_qseecom_allowlist)) {
20682053
dev_info(scm->dev, "qseecom: untested machine, skipping\n");
20692054
return 0;
20702055
}

0 commit comments

Comments
 (0)