]> git.ipfire.org Git - thirdparty/u-boot.git/blobdiff - scripts/checkpatch.pl
Merge tag 'v2024.01-rc3' into next
[thirdparty/u-boot.git] / scripts / checkpatch.pl
index ccfcbb3e1255bbe3cd5ef7d725e2045dd40ba686..b8eb57f38c74ae2feae98f9021d2c408ab579bbb 100755 (executable)
@@ -2606,8 +2606,8 @@ sub u_boot_line {
                     "Possible new uclass - make sure to add a sandbox driver, plus a test in test/dm/<name>.c\n" . $herecurr);
        }
 
-       # try to get people to use the livetree API
-       if ($line =~ /^\+.*fdtdec_/) {
+       # try to get people to use the livetree API, except when changing tooling
+       if ($line =~ /^\+.*fdtdec_/ && $realfile !~ /^tools\//) {
                WARN("LIVETREE",
                     "Use the livetree API (dev_read_...)\n" . $herecurr);
        }
@@ -2636,12 +2636,18 @@ sub u_boot_line {
                      "All CONFIG symbols are managed by Kconfig\n" . $herecurr);
        }
 
-       # Don't put common.h and dm.h in header files
-       if ($realfile =~ /\.h$/ && $rawline =~ /^\+#include\s*<(common|dm)\.h>*/) {
+       # Don't put dm.h in header files
+       if ($realfile =~ /\.h$/ && $rawline =~ /^\+#include\s*<dm\.h>*/) {
                ERROR("BARRED_INCLUDE_IN_HDR",
                      "Avoid including common.h and dm.h in header files\n" . $herecurr);
        }
 
+       # Don't add common.h to files
+       if ($rawline =~ /^\+#include\s*<common\.h>*/) {
+               ERROR("BARRED_INCLUDE_COMMON_H",
+                     "Do not add common.h to files\n" . $herecurr);
+       }
+
        # Do not disable fdt / initrd relocation
        if ($rawline =~ /^\+.*(fdt|initrd)_high=0xffffffff/) {
                ERROR("DISABLE_FDT_OR_INITRD_RELOC",
@@ -2680,6 +2686,12 @@ sub u_boot_line {
                "DEVICE_PRIV_AUTO", $herecurr);
        u_boot_struct_name($line, "per_device_plat_auto", "_plat",
                "DEVICE_PLAT_AUTO", $herecurr);
+
+       # Avoid using the pre-schema driver model tags
+       if ($line =~ /^\+.*u-boot,dm-.*/) {
+               ERROR("PRE_SCHEMA",
+                     "Driver model schema uses 'bootph-...' tags now\n" . $herecurr);
+       }
 }
 
 sub exclude_global_initialisers {