Skip to content

Commit 50c9290

Browse files
lkundraktorvalds
authored andcommitted
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]>
1 parent 44d303e commit 50c9290

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

scripts/checkpatch.pl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3157,6 +3157,17 @@ sub process {
31573157
WARN("SPDX_LICENSE_TAG",
31583158
"'$spdx_license' is not supported in LICENSES/...\n" . $herecurr);
31593159
}
3160+
if ($realfile =~ m@^Documentation/devicetree/bindings/@ &&
3161+
not $spdx_license =~ /GPL-2\.0.*BSD-2-Clause/) {
3162+
my $msg_level = \&WARN;
3163+
$msg_level = \&CHK if ($file);
3164+
if (&{$msg_level}("SPDX_LICENSE_TAG",
3165+
3166+
"DT binding documents should be licensed (GPL-2.0-only OR BSD-2-Clause)\n" . $herecurr) &&
3167+
$fix) {
3168+
$fixed[$fixlinenr] =~ s/SPDX-License-Identifier: .*/SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)/;
3169+
}
3170+
}
31603171
}
31613172
}
31623173
}

0 commit comments

Comments
 (0)