From ef79ef21a85272f52be58089a96bc1299aa04458 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 21 Jan 2021 13:57:10 -0700 Subject: dm: core: Don't inline dev_read...() calls with of-platdata At present if these calls are used with of-platdata, a confusing error is produced, referring to a function not actually called by the code causing the problem. Fix this by not inlining, so that the error mentions the dev_read_...() function and it is more obvious what is going on. Signed-off-by: Simon Glass --- include/dm/read.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'include/dm') diff --git a/include/dm/read.h b/include/dm/read.h index c875e11a132..f6f8b875d1c 100644 --- a/include/dm/read.h +++ b/include/dm/read.h @@ -30,8 +30,7 @@ static inline const struct device_node *dev_np(const struct udevice *dev) } #endif -#ifndef CONFIG_DM_DEV_READ_INLINE - +#if !defined(CONFIG_DM_DEV_READ_INLINE) || CONFIG_IS_ENABLED(OF_PLATDATA) /** * dev_read_u32() - read a 32-bit integer from a device's DT property * -- cgit v1.2.3 From a00e0f7ae5a3058dc8dd520d1d449d4c8806e5f8 Mon Sep 17 00:00:00 2001 From: Stanislav Pinchuk Date: Wed, 20 Jan 2021 21:52:23 +0300 Subject: do not pass NULL pointer to libfdt Re-send because of line-wraps. Without this patch, u-boot just hangs if the fdt pointer is not initialized. The diagnostic subsystems are not yet initialized, so all you get is a blind hang. Signed-off-by: Stanislav.Pinchuk@kaspersky.com --- include/dm/read.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/dm') diff --git a/include/dm/read.h b/include/dm/read.h index f6f8b875d1c..03ba98232a6 100644 --- a/include/dm/read.h +++ b/include/dm/read.h @@ -1006,7 +1006,7 @@ static inline u64 dev_translate_dma_address(const struct udevice *dev, static inline int dev_read_alias_highest_id(const char *stem) { - if (!CONFIG_IS_ENABLED(OF_LIBFDT)) + if (!CONFIG_IS_ENABLED(OF_LIBFDT) || !gd->fdt_blob) return -1; return fdtdec_get_alias_highest_id(gd->fdt_blob, stem); } -- cgit v1.2.3 From fabae8711fd74c0b803f62fd24d28d6712042c2f Mon Sep 17 00:00:00 2001 From: Dario Binacchi Date: Sat, 23 Jan 2021 19:48:57 +0100 Subject: dm: replace auto_alloc_size with auto The auto_alloc_size members of struct driver has been renamed auto. Signed-off-by: Dario Binacchi Reviewed-by: Simon Glass --- include/dm/device.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/dm') diff --git a/include/dm/device.h b/include/dm/device.h index f5b4cd6876e..e665558444b 100644 --- a/include/dm/device.h +++ b/include/dm/device.h @@ -111,7 +111,7 @@ enum { * probe method if the device has a device tree node. * * All three of plat, priv and uclass_priv can be allocated by the - * driver, or you can use the auto_alloc_size members of struct driver and + * driver, or you can use the auto members of struct driver and * struct uclass_driver to have driver model do this automatically. * * @driver: The driver used by this device -- cgit v1.2.3