-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
of: Add self test for of_match_node()
Adds a selftest function for the of_match_node function. of_match_node is supposed to handle precedence for the compatible property as well as the name and device_type values. This patch adds some test case data and a function that makes sure each test node matches against the correct entry of an of_device_id table. This code was written to verify the new of_match_node() implementation that is an earlier part of this series. Signed-off-by: Grant Likely <grant.likely@linaro.org> Cc: Kevin Hao <haokexin@gmail.com>
- Loading branch information
Grant Likely
committed
Feb 20, 2014
1 parent
b519051
commit 1f42e5d
Showing
3 changed files
with
87 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
#include "tests-phandle.dtsi" | ||
#include "tests-interrupts.dtsi" | ||
#include "tests-match.dtsi" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
|
||
/ { | ||
testcase-data { | ||
match-node { | ||
name0 { }; | ||
name1 { device_type = "type1"; }; | ||
a { name2 { device_type = "type1"; }; }; | ||
b { name2 { }; }; | ||
c { name2 { device_type = "type2"; }; }; | ||
name3 { compatible = "compat3"; }; | ||
name4 { compatible = "compat2", "compat3"; }; | ||
name5 { compatible = "compat2", "compat3"; }; | ||
name6 { compatible = "compat1", "compat2", "compat3"; }; | ||
name7 { compatible = "compat2"; device_type = "type1"; }; | ||
name8 { compatible = "compat2"; device_type = "type1"; }; | ||
name9 { compatible = "compat2"; }; | ||
}; | ||
}; | ||
}; |