summaryrefslogtreecommitdiff
path: root/drivers/core/device.c
diff options
context:
space:
mode:
authorMarek Vasut <marek.vasut+renesas@gmail.com>2019-08-31 18:03:28 +0200
committerMarek Vasut <marex@denx.de>2019-09-02 17:38:42 +0200
commitd7677bfc04920aa5e6a7c886a5095bcd53e0503a (patch)
tree1b7d1fda5a0139123e22caa723bca2cc4e9affe7 /drivers/core/device.c
parentd22c8be964a870f59d2fdab6c67cefa0c4799364 (diff)
dm: core: Decouple DM from DT
Some of the DM functions depend on OF_CONTROL, which is incorrect. DM and DT are orthogonal. Add macro guards around such functions to avoid compiling them in when DM is enabled, while OF_CONTROL is not. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/core/device.c')
-rw-r--r--drivers/core/device.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/core/device.c b/drivers/core/device.c
index 474c1642ee..05dadf98f9 100644
--- a/drivers/core/device.c
+++ b/drivers/core/device.c
@@ -526,6 +526,7 @@ static int device_get_device_tail(struct udevice *dev, int ret,
return 0;
}
+#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
/**
* device_find_by_ofnode() - Return device associated with given ofnode
*
@@ -552,6 +553,7 @@ static int device_find_by_ofnode(ofnode node, struct udevice **devp)
return -ENODEV;
}
+#endif
int device_get_child(struct udevice *parent, int index, struct udevice **devp)
{
@@ -817,6 +819,7 @@ int device_set_name(struct udevice *dev, const char *name)
return 0;
}
+#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
bool device_is_compatible(struct udevice *dev, const char *compat)
{
return ofnode_device_is_compatible(dev_ofnode(dev), compat);
@@ -879,3 +882,4 @@ int dev_enable_by_path(const char *path)
return lists_bind_fdt(parent, node, NULL, false);
}
+#endif