From b52d6de20768ddba6b9e75d198179eca6ec66300 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Mon, 3 Apr 2023 20:46:50 +0200 Subject: common: static fdt_simplefb_enable_existing_node() Function fdt_simplefb_enable_existing_node() should be static as it is not used outside common/fdt_simplefb.c. Signed-off-by: Heinrich Schuchardt Reviewed-by: Simon Glass --- include/fdt_simplefb.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/fdt_simplefb.h b/include/fdt_simplefb.h index 41cd740ac05..af93e3be631 100644 --- a/include/fdt_simplefb.h +++ b/include/fdt_simplefb.h @@ -9,6 +9,5 @@ #ifndef _FDT_SIMPLEFB_H_ #define _FDT_SIMPLEFB_H_ int fdt_simplefb_add_node(void *blob); -int fdt_simplefb_enable_existing_node(void *blob); int fdt_simplefb_enable_and_mem_rsv(void *blob); #endif -- cgit v1.2.3 From c71ee7e163550069828b89247dd7228d35cf10c7 Mon Sep 17 00:00:00 2001 From: Andrew Davis Date: Tue, 4 Apr 2023 13:45:41 -0500 Subject: binman: Use unsigned long over typedef ulong The header binman_sym.h depends on ulong typedef but does not include types.h. This means the header must be included after including types.h or a header that includes it. We could include types.h but instead let's just switch from ulong to directly using unsigned long. This removes the need for typedef'ing it in some of the tests, so also remove those. Signed-off-by: Andrew Davis Reviewed-by: Simon Glass --- include/binman_sym.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/binman_sym.h b/include/binman_sym.h index 528d7e4e90e..49a95eafade 100644 --- a/include/binman_sym.h +++ b/include/binman_sym.h @@ -71,7 +71,7 @@ * value #defined above. This is used to check at runtime if the * symbol values were filled in and are OK to use. */ -extern ulong _binman_sym_magic; +extern unsigned long _binman_sym_magic; /** * DECLARE_BINMAN_MAGIC_SYM - Declare the internal magic symbol @@ -81,7 +81,7 @@ extern ulong _binman_sym_magic; * definitions of the symbol. */ #define DECLARE_BINMAN_MAGIC_SYM \ - ulong _binman_sym_magic \ + unsigned long _binman_sym_magic \ __attribute__((aligned(4), section(".binman_sym"))) /** @@ -93,14 +93,14 @@ extern ulong _binman_sym_magic; * Return: 1 if binman symbol values are usable, 0 if not */ #define BINMAN_SYMS_OK \ - (*(ulong *)&_binman_sym_magic == BINMAN_SYM_MAGIC_VALUE) + (*(unsigned long *)&_binman_sym_magic == BINMAN_SYM_MAGIC_VALUE) /** * binman_sym() - Access a previously declared symbol * * This is used to get the value of a symbol. E.g.: * - * ulong address = binman_sym(ulong, u_boot_spl, pos); + * unsigned long address = binman_sym(unsigned long, u_boot_spl, pos); * * @_type: Type f the symbol (e.g. unsigned long) * @entry_name: Name of the entry to look for (e.g. 'u_boot_spl') -- cgit v1.2.3 From 1a07d395210cc0e9a114826e0b42106fd4336f46 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Wed, 5 Apr 2023 11:34:15 +0200 Subject: sandbox: fix return type of os_filesize() Given a file ../img of size 4294967296 with GPT partition table and partitions: => host bind 0 ../img => part list host 0 Disk host-0.blk not ready The cause is os_filesize() returning int. File sizes must use off_t. Correct all uses of os_filesize() too. Signed-off-by: Heinrich Schuchardt Reviewed-by: Simon Glass --- include/os.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/os.h b/include/os.h index 0415f0f0e7a..968412b0a82 100644 --- a/include/os.h +++ b/include/os.h @@ -64,7 +64,7 @@ off_t os_lseek(int fd, off_t offset, int whence); * @fd: File descriptor as returned by os_open() * Return: file size or negative error code */ -int os_filesize(int fd); +off_t os_filesize(int fd); /** * Access to the OS open() system call -- cgit v1.2.3 From ca031c082700631264d1e058f2f705438c2be8c2 Mon Sep 17 00:00:00 2001 From: Rasmus Villemoes Date: Thu, 13 Apr 2023 17:17:03 +0200 Subject: dm: core: introduce uclass_get_device_by_of_path() There's quite a few instances of board-specific code doing off = fdt_path_offset(gd->fdt_blob, ...); ... ret = uclass_get_device_by_of_offset(..., off, &dev); looking for an eeprom or a pmic via some alias. Such code can be simplified a little if we have a helper for directly getting a device via device tree path (including being given as an alias). Implement it in terms of ofnode rather than raw offsets so that this will work whether live tree is enabled or not. Signed-off-by: Rasmus Villemoes --- include/dm/uclass.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'include') diff --git a/include/dm/uclass.h b/include/dm/uclass.h index ee15c920633..5c5fb9acac0 100644 --- a/include/dm/uclass.h +++ b/include/dm/uclass.h @@ -264,6 +264,23 @@ int uclass_get_device_by_of_offset(enum uclass_id id, int node, int uclass_get_device_by_ofnode(enum uclass_id id, ofnode node, struct udevice **devp); +/** + * uclass_get_device_by_of_path() - Get a uclass device by device tree path + * + * This searches the devices in the uclass for one attached to the + * device tree node corresponding to the given path (which may also be + * an alias). + * + * The device is probed to activate it ready for use. + * + * @id: ID to look up + * @node: Device tree path to search for (if no such path then -ENODEV is returned) + * @devp: Returns pointer to device (there is only one for each node) + * Return: 0 if OK, -ve on error + */ +int uclass_get_device_by_of_path(enum uclass_id id, const char *path, + struct udevice **devp); + /** * uclass_get_device_by_phandle_id() - Get a uclass device by phandle id * -- cgit v1.2.3