summaryrefslogtreecommitdiff
path: root/rust/kernel
diff options
context:
space:
mode:
authorKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>2025-11-12 11:28:46 +0100
committerRob Herring (Arm) <robh@kernel.org>2025-11-26 19:38:24 -0600
commit4a93adcbd201aad5ba607810cfe1b19d44e5d171 (patch)
tree0aab3e49bdb3ecf087c19c4081ca04157beed7c3 /rust/kernel
parentdf2602e1c68af8ea5e6e91da9e48a4312b88e943 (diff)
of: Add wrappers to match root node with OF device ID tables
Several drivers duplicate same code for getting reference to the root node, matching it against 'struct of_device_id' table and getting out the match data from the table entry. There is a of_machine_compatible_match() wrapper but it takes array of strings, which is not suitable for many drivers since they want the driver data associated with each compatible. Add two wrappers, similar to existing of_device_get_match_data(): 1. of_machine_device_match() doing only matching against 'struct of_device_id' and returning bool. 2. of_machine_get_match_data() doing the matching and returning associated driver data for found compatible. Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Reviewed-by: Lukasz Luba <lukasz.luba@arm.com> Tested-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Link: https://patch.msgid.link/20251112-b4-of-match-matchine-data-v2-1-d46b72003fd6@linaro.org Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
Diffstat (limited to 'rust/kernel')
0 files changed, 0 insertions, 0 deletions