]> git.baikalelectronics.ru Git - uboot.git/commitdiff
checkpatch: Add a warning for pre-schema driver model tags
authorSimon Glass <sjg@chromium.org>
Mon, 13 Feb 2023 15:56:38 +0000 (08:56 -0700)
committerSimon Glass <sjg@chromium.org>
Tue, 14 Feb 2023 16:43:27 +0000 (09:43 -0700)
Help ensure that these don't creep into development by adding a check in
checkpatch for them.

Signed-off-by: Simon Glass <sjg@chromium.org>
scripts/checkpatch.pl
tools/patman/test_checkpatch.py

index ccfcbb3e1255bbe3cd5ef7d725e2045dd40ba686..62b764f6c3835839f0175be7dcae5318c12b01df 100755 (executable)
@@ -2680,6 +2680,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 {
index 4c2ab6e590ed4050188c8c127979e9f5b4f1d4d9..a8bb364e42b22828cf01ba55565ab6134212b98f 100644 (file)
@@ -452,6 +452,12 @@ index 0000000..2234c87
         self.check_strl("cat");
         self.check_strl("cpy");
 
+    def test_schema(self):
+        """Check for uses of strn(cat|cpy)"""
+        pm = PatchMaker()
+        pm.add_line('arch/sandbox/dts/sandbox.dtsi', '\tu-boot,dm-pre-proper;')
+        self.check_single_message(pm, 'PRE_SCHEMA', 'error')
+
 if __name__ == "__main__":
     unittest.main()
     gitutil.RunTests()