[U-Boot] [PATCH 1/2] dm: core: Provide uclass_find_device_by_phandle() only when needed

This function cannot be used unless support is enabled for device tree control. Adjust the code to reflect that.
Signed-off-by: Simon Glass sjg@chromium.org ---
drivers/core/uclass.c | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/drivers/core/uclass.c b/drivers/core/uclass.c index 1af0947..36bcf19 100644 --- a/drivers/core/uclass.c +++ b/drivers/core/uclass.c @@ -278,6 +278,7 @@ static int uclass_find_device_by_of_offset(enum uclass_id id, int node, return -ENODEV; }
+#if CONFIG_IS_ENABLED(OF_CONTROL) static int uclass_find_device_by_phandle(enum uclass_id id, struct udevice *parent, const char *name, @@ -308,6 +309,7 @@ static int uclass_find_device_by_phandle(enum uclass_id id,
return -ENODEV; } +#endif
int uclass_get_device_tail(struct udevice *dev, int ret, struct udevice **devp) @@ -374,6 +376,7 @@ int uclass_get_device_by_of_offset(enum uclass_id id, int node, return uclass_get_device_tail(dev, ret, devp); }
+#if CONFIG_IS_ENABLED(OF_CONTROL) int uclass_get_device_by_phandle(enum uclass_id id, struct udevice *parent, const char *name, struct udevice **devp) { @@ -384,6 +387,7 @@ int uclass_get_device_by_phandle(enum uclass_id id, struct udevice *parent, ret = uclass_find_device_by_phandle(id, parent, name, &dev); return uclass_get_device_tail(dev, ret, devp); } +#endif
int uclass_first_device(enum uclass_id id, struct udevice **devp) {

This enables driver model for all boards in U-Boot. This is required to support driver-model serial.
I'm not sure when is a good time to apply this patch. We can sit on it until it makes sense.
Signed-off-by: Simon Glass sjg@chromium.org ---
drivers/core/Kconfig | 1 + 1 file changed, 1 insertion(+)
diff --git a/drivers/core/Kconfig b/drivers/core/Kconfig index f332480..07292c1 100644 --- a/drivers/core/Kconfig +++ b/drivers/core/Kconfig @@ -2,6 +2,7 @@ menu "Generic Driver Options"
config DM bool "Enable Driver Model" + default y help This config option enables Driver Model. This brings in the core support, including scanning of platform data on start-up. If

On 19 December 2015 at 19:38, Simon Glass sjg@chromium.org wrote:
This function cannot be used unless support is enabled for device tree control. Adjust the code to reflect that.
Signed-off-by: Simon Glass sjg@chromium.org
drivers/core/uclass.c | 4 ++++ 1 file changed, 4 insertions(+)
Applied to u-boot-dm.
participants (1)
-
Simon Glass