Skip to content

Commit e400edb

Browse files
committed
checkpatch: Warn if DT bindings are not in schema format
DT bindings are moving to using a json-schema based schema format instead of freeform text. Add a checkpatch.pl check to encourage using the schema for new bindings. It's not yet a requirement, but is progressively being required by some maintainers. Cc: Andy Whitcroft <apw@canonical.com> Cc: Joe Perches <joe@perches.com> Signed-off-by: Rob Herring <robh@kernel.org>
1 parent a4dc1ca commit e400edb

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

‎scripts/checkpatch.pl‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2826,6 +2826,14 @@ sub process {
28262826
"added, moved or deleted file(s), does MAINTAINERS need updating?\n" . $herecurr);
28272827
}
28282828

2829+
# Check for adding new DT bindings not in schema format
2830+
if (!$in_commit_log &&
2831+
($line =~ /^new file mode\s*\d+\s*$/) &&
2832+
($realfile =~ m@^Documentation/devicetree/bindings/.*\.txt$@)) {
2833+
WARN("DT_SCHEMA_BINDING_PATCH",
2834+
"DT bindings should be in DT schema format. See: Documentation/devicetree/writing-schema.rst\n");
2835+
}
2836+
28292837
# Check for wrappage within a valid hunk of the file
28302838
if ($realcnt != 0 && $line !~ m{^(?:\+|-| |\\ No newline|$)}) {
28312839
ERROR("CORRUPTED_PATCH",

0 commit comments

Comments
 (0)