aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLubomir Rintel <[email protected]>2020-04-06 20:11:13 -0700
committerLinus Torvalds <[email protected]>2020-04-07 10:43:43 -0700
commit50c92900214dd9a55bcecc3c53e90d072aff6560 (patch)
tree37443645cc27c9aace5a1027b6d0e891285e7247
parent44d303eb05ef1a24fec96580aa8a8d6f555e9b7e (diff)
checkpatch: check proper licensing of Devicetree bindings
According to Devicetree maintainers (see Link: below), the Devicetree binding documents are preferrably licensed (GPL-2.0-only OR BSD-2-Clause). Let's check that. The actual check is a bit more relaxed, to allow more liberal but compatible licensing (e.g. GPL-2.0-or-later OR BSD-2-Clause). Signed-off-by: Lubomir Rintel <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Acked-by: Joe Perches <[email protected]> Acked-by: Laurent Pinchart <[email protected]> Cc: Rob Herring <[email protected]> Cc: Neil Armstrong <[email protected]> Cc: Laurent Pinchart <[email protected]>, Cc: Jonas Karlman <[email protected]>, Cc: Jernej Skrabec <[email protected]>, Cc: Mark Rutland <[email protected]>, Cc: David Airlie <[email protected]> Cc: Daniel Vetter <[email protected]>, Link: https://lore.kernel.org/lkml/20200108142132.GA4830@bogus/ Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Linus Torvalds <[email protected]>
-rwxr-xr-xscripts/checkpatch.pl11
1 files changed, 11 insertions, 0 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 64cfd617eefc..460a6b5b9d9a 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -3157,6 +3157,17 @@ sub process {
WARN("SPDX_LICENSE_TAG",
"'$spdx_license' is not supported in LICENSES/...\n" . $herecurr);
}
+ if ($realfile =~ m@^Documentation/devicetree/bindings/@ &&
+ not $spdx_license =~ /GPL-2\.0.*BSD-2-Clause/) {
+ my $msg_level = \&WARN;
+ $msg_level = \&CHK if ($file);
+ if (&{$msg_level}("SPDX_LICENSE_TAG",
+
+ "DT binding documents should be licensed (GPL-2.0-only OR BSD-2-Clause)\n" . $herecurr) &&
+ $fix) {
+ $fixed[$fixlinenr] =~ s/SPDX-License-Identifier: .*/SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)/;
+ }
+ }
}
}
}