When there is no device tree there is not point in trying to find nodes, etc. since they will all be null. Add static inlines to skip the code in that case. Unfortunately this makes the file a little convoluted and there are two inlines for ofnode_is_enabled() and ofnode_first/next_subnode(). But it seems better than the alternative. We could also consider splitting up the header file. Also add a rule in drivers/Makefile to compile ofnode.o when OF_REAL is enabled but DM is not (for kontron-sl-mx6ul) and move the ofnode_for_each_compatible_node/prop() macros outside the OF_REAL condition, since they only use functions that have stubs. Series-to: concept Series-cc: heinrich Co-developed-by: Claude <noreply@anthropic.com> Signed-off-by: Simon Glass <simon.glass@canonical.com>
23 lines
818 B
Makefile
23 lines
818 B
Makefile
# SPDX-License-Identifier: GPL-2.0+
|
|
#
|
|
# Copyright (c) 2013 Google, Inc
|
|
|
|
obj-y += device.o fdtaddr.o lists.o root.o uclass.o util.o tag.o
|
|
obj-$(CONFIG_$(PHASE_)ACPIGEN) += acpi.o
|
|
obj-$(CONFIG_$(PHASE_)DEVRES) += devres.o
|
|
obj-$(CONFIG_$(PHASE_)DM_DEVICE_REMOVE) += device-remove.o
|
|
obj-$(CONFIG_$(PHASE_)SIMPLE_BUS) += simple-bus.o
|
|
obj-$(CONFIG_SIMPLE_PM_BUS) += simple-pm-bus.o
|
|
obj-$(CONFIG_DM) += dump.o
|
|
obj-$(CONFIG_$(PHASE_)REGMAP) += regmap.o
|
|
obj-$(CONFIG_$(PHASE_)SYSCON) += syscon-uclass.o
|
|
obj-$(CONFIG_$(PHASE_)OF_LIVE) += of_access.o of_addr.o
|
|
ifndef CONFIG_DM_DEV_READ_INLINE
|
|
obj-$(CONFIG_OF_CONTROL) += read.o
|
|
endif
|
|
obj-$(CONFIG_$(PHASE_)OF_PLATDATA) += read.o
|
|
obj-$(CONFIG_OF_CONTROL) += of_extra.o read_extra.o
|
|
obj-$(CONFIG_$(PHASE_)OF_REAL) += ofnode.o ofnode_graph.o
|
|
|
|
ccflags-$(CONFIG_DM_DEBUG) += -DDEBUG
|