mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-12-28 06:44:36 -05:00
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>
This commit is contained in:
committed by
Rob Herring (Arm)
parent
4b94d21fac
commit
f83b427057
@@ -2018,21 +2018,6 @@ static const struct of_device_id qcom_scm_qseecom_allowlist[] __maybe_unused = {
|
||||
{ }
|
||||
};
|
||||
|
||||
static bool qcom_scm_qseecom_machine_is_allowed(void)
|
||||
{
|
||||
struct device_node *np;
|
||||
bool match;
|
||||
|
||||
np = of_find_node_by_path("/");
|
||||
if (!np)
|
||||
return false;
|
||||
|
||||
match = of_match_node(qcom_scm_qseecom_allowlist, np);
|
||||
of_node_put(np);
|
||||
|
||||
return match;
|
||||
}
|
||||
|
||||
static void qcom_scm_qseecom_free(void *data)
|
||||
{
|
||||
struct platform_device *qseecom_dev = data;
|
||||
@@ -2064,7 +2049,7 @@ static int qcom_scm_qseecom_init(struct qcom_scm *scm)
|
||||
|
||||
dev_info(scm->dev, "qseecom: found qseecom with version 0x%x\n", version);
|
||||
|
||||
if (!qcom_scm_qseecom_machine_is_allowed()) {
|
||||
if (!of_machine_device_match(qcom_scm_qseecom_allowlist)) {
|
||||
dev_info(scm->dev, "qseecom: untested machine, skipping\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user