Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

dt-bindings: kbuild: Support partial matches with DT_SCHEMA_FILES

DT_SCHEMA_FILES is currently restricted to a list of exact files with
the full source tree path (i.e. Documentation/devicetree/bindings/...).
Loosen this requirement and let DT_SCHEMA_FILES be a partial match.

With this, checking all schema files in a directory is possible:

$ make DT_SCHEMA_FILES=/gpio/ dt_binding_check

Or all schema files with 'qcom' in the path or filename:

$ make DT_SCHEMA_FILES=qcom dt_binding_check

Cc: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Rob Herring <robh@kernel.org>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Link: https://lore.kernel.org/r/20220228201006.1484903-1-robh@kernel.org

+10 -14
+5 -10
Documentation/devicetree/bindings/Makefile
··· 31 31 -name 'processed-schema*' ! \ 32 32 -name '*.example.dt.yaml' \) 33 33 34 - ifeq ($(DT_SCHEMA_FILES),) 35 - find_cmd = $(find_all_cmd) 36 - else 37 - find_cmd = echo $(addprefix $(srctree)/, $(DT_SCHEMA_FILES)) 38 - endif 34 + find_cmd = $(find_all_cmd) | grep -F "$(DT_SCHEMA_FILES)" 35 + CHK_DT_DOCS := $(shell $(find_cmd)) 39 36 40 37 quiet_cmd_yamllint = LINT $(src) 41 38 cmd_yamllint = ($(find_cmd) | \ ··· 80 83 $(obj)/processed-schema.json: $(obj)/processed-schema-examples.json FORCE 81 84 $(call if_changed,copy) 82 85 83 - DT_SCHEMA_FILES = $(DT_DOCS) 84 - 85 86 else 86 87 87 88 # If DT_SCHEMA_FILES is specified, use it for processed-schema.json 88 89 89 90 $(obj)/processed-schema.json: DT_MK_SCHEMA_FLAGS := -u 90 - $(obj)/processed-schema.json: $(DT_SCHEMA_FILES) check_dtschema_version FORCE 91 + $(obj)/processed-schema.json: $(CHK_DT_DOCS) check_dtschema_version FORCE 91 92 $(call if_changed,mk_schema) 92 93 93 94 endif 94 95 95 96 always-$(CHECK_DT_BINDING) += processed-schema-examples.json 96 97 always-$(CHECK_DTBS) += processed-schema.json 97 - always-$(CHECK_DT_BINDING) += $(patsubst $(src)/%.yaml,%.example.dts, $(DT_SCHEMA_FILES)) 98 - always-$(CHECK_DT_BINDING) += $(patsubst $(src)/%.yaml,%.example.dt.yaml, $(DT_SCHEMA_FILES)) 98 + always-$(CHECK_DT_BINDING) += $(patsubst $(srctree)/$(src)/%.yaml,%.example.dts, $(CHK_DT_DOCS)) 99 + always-$(CHECK_DT_BINDING) += $(patsubst $(srctree)/$(src)/%.yaml,%.example.dt.yaml, $(CHK_DT_DOCS)) 99 100 100 101 # Hack: avoid 'Argument list too long' error for 'make clean'. Remove most of 101 102 # build artifacts here before they are processed by scripts/Makefile.clean
+5 -4
Documentation/devicetree/bindings/writing-schema.rst
··· 157 157 158 158 make dt_binding_check dtbs_check 159 159 160 - It is also possible to run checks with a single schema file by setting the 161 - ``DT_SCHEMA_FILES`` variable to a specific schema file. 160 + It is also possible to run checks with a subset of matching schema files by 161 + setting the ``DT_SCHEMA_FILES`` variable to a specific schema file or pattern. 162 162 163 163 :: 164 164 165 - make dt_binding_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/trivial-devices.yaml 166 - make dtbs_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/trivial-devices.yaml 165 + make dt_binding_check DT_SCHEMA_FILES=trivial-devices.yaml 166 + make dt_binding_check DT_SCHEMA_FILES=/gpio/ 167 + make dtbs_check DT_SCHEMA_FILES=trivial-devices.yaml 167 168 168 169 169 170 json-schema Resources