diff options
author | Rob Herring <robh@kernel.org> | 2019-09-12 15:18:20 +0100 |
---|---|---|
committer | Rob Herring <robh@kernel.org> | 2019-10-11 14:33:02 -0500 |
commit | e400edb141d74aa2f04d0071aadb47fdb8f7ae55 (patch) | |
tree | aad728e38b34ef0f1af47b655851b743954106ee /scripts/checkpatch.pl | |
parent | a4dc1ca607e47e3ab342fb1a78b98bdc15088e7f (diff) | |
download | linux-e400edb141d74aa2f04d0071aadb47fdb8f7ae55.tar.bz2 |
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>
Diffstat (limited to 'scripts/checkpatch.pl')
-rwxr-xr-x | scripts/checkpatch.pl | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 6fcc66afb088..375c1e17562c 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -2826,6 +2826,14 @@ sub process { "added, moved or deleted file(s), does MAINTAINERS need updating?\n" . $herecurr); } +# Check for adding new DT bindings not in schema format + if (!$in_commit_log && + ($line =~ /^new file mode\s*\d+\s*$/) && + ($realfile =~ m@^Documentation/devicetree/bindings/.*\.txt$@)) { + WARN("DT_SCHEMA_BINDING_PATCH", + "DT bindings should be in DT schema format. See: Documentation/devicetree/writing-schema.rst\n"); + } + # Check for wrappage within a valid hunk of the file if ($realcnt != 0 && $line !~ m{^(?:\+|-| |\\ No newline|$)}) { ERROR("CORRUPTED_PATCH", |