In some cases an hardware peripheral can be used for two exclusive usages. For example, on STM32MP15 we have the same peripheral for I2S and SPI. We have dedicated driver for each usage and so a dedicated device node in devicetree. To avoid to get useless warnings running "make W=1 dtbs", this patch adds the "-Wunique_unit_address_if_enabled" flag for a make with W=1. In this case we will detect a duplicate address only if both devices are enabled in the devicetree, which is a real error case.
Showing the changes to scripts (1 of 1 file). Show all
Unified · Split
| @@ -334,7 +334,8 @@ quiet_cmd_gzip = GZIP $@ · 333 unmodified lines | ||
| 334 | 334 | # DTC |
| 335 | 335 | # --------------------------------------------------------------------------- |
| 336 | 336 | DTC ?= $(objtree)/scripts/dtc/dtc |
| 337 | −DTC_FLAGS += -Wno-interrupt_provider | |
| 337 | +DTC_FLAGS += -Wno-interrupt_provider \ | |
| 338 | + -Wno-unique_unit_address | |
| 338 | 339 | |
| 339 | 340 | # Disable noisy checks by default |
| 340 | 341 | ifeq ($(findstring 1,$(KBUILD_EXTRA_WARN)),) |
| @@ -342,14 +343,17 @@ DTC_FLAGS += -Wno-unit_address_vs_reg \ · 1 unmodified line | ||
| 342 | 343 | -Wno-avoid_unnecessary_addr_size \ |
| 343 | 344 | -Wno-alias_paths \ |
| 344 | 345 | -Wno-graph_child_address \ |
| 345 | − -Wno-simple_bus_reg \ | |
| 346 | − -Wno-unique_unit_address | |
| 346 | + -Wno-simple_bus_reg | |
| 347 | +else | |
| 348 | +DTC_FLAGS += \ | |
| 349 | + -Wunique_unit_address_if_enabled | |
| 347 | 350 | endif |
| 348 | 351 | |
| 349 | 352 | ifneq ($(findstring 2,$(KBUILD_EXTRA_WARN)),) |
| 350 | 353 | DTC_FLAGS += -Wnode_name_chars_strict \ |
| 351 | 354 | -Wproperty_name_chars_strict \ |
| 352 | − -Winterrupt_provider | |
| 355 | + -Winterrupt_provider \ | |
| 356 | + -Wunique_unit_address | |
| 353 | 357 | endif |
| 354 | 358 | |
| 355 | 359 | DTC_FLAGS += $(DTC_FLAGS_$(basetarget)) |