From d7e9de7ec1bb79261c08e7689a1856a464ee2443 Mon Sep 17 00:00:00 2001 From: Patrick Delaunay Date: Tue, 27 Sep 2022 10:18:05 +0200 Subject: fdt_support: cosmetic: remove fdt_fixup_nor_flash_size prototype Remove prototype for the removed function fdt_fixup_nor_flash_size. This patch has no impact as the function is never used. Fixes: 98f705c9cefd ("powerpc: remove 4xx support") Signed-off-by: Patrick Delaunay Reviewed-by: Simon Glass --- include/fdt_support.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'include') diff --git a/include/fdt_support.h b/include/fdt_support.h index b8380716f39..5638bd4f165 100644 --- a/include/fdt_support.h +++ b/include/fdt_support.h @@ -243,8 +243,6 @@ int fdt_increase_size(void *fdt, int add_len); int fdt_delete_disabled_nodes(void *blob); -int fdt_fixup_nor_flash_size(void *blob); - struct node_info; #if defined(CONFIG_FDT_FIXUP_PARTITIONS) void fdt_fixup_mtdparts(void *fdt, const struct node_info *node_info, -- cgit v1.2.3 From 1fcfadcb82a21af058baa5dea2b20883b8c388b8 Mon Sep 17 00:00:00 2001 From: Michal Suchanek Date: Tue, 27 Sep 2022 23:25:24 +0200 Subject: dm: pci: Fix doc typo first -> next pci_find_first_device description says it can be used for iteration with itself but it should really be with pci_find_next_device Signed-off-by: Michal Suchanek --- include/pci.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/pci.h b/include/pci.h index d7ed35dd523..c55d6107a49 100644 --- a/include/pci.h +++ b/include/pci.h @@ -957,7 +957,7 @@ int pci_bus_find_devfn(const struct udevice *bus, pci_dev_t find_devfn, /** * pci_find_first_device() - return the first available PCI device * - * This function and pci_find_first_device() allow iteration through all + * This function and pci_find_next_device() allow iteration through all * available PCI devices on all buses. Assuming there are any, this will * return the first one. * -- cgit v1.2.3 From 58ddb937e1699de241e4aa39de90a68a0be71744 Mon Sep 17 00:00:00 2001 From: Michal Suchanek Date: Sun, 25 Sep 2022 13:08:16 +0200 Subject: dm: core: Switch uclass_*_device_err to use uclass_*_device_check Clarify documentation, fix a few more cases that could be broken by the change. Signed-off-by: Michal Suchanek --- include/dm/uclass.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/dm/uclass.h b/include/dm/uclass.h index 823a16527f7..b1c016ef9f5 100644 --- a/include/dm/uclass.h +++ b/include/dm/uclass.h @@ -350,7 +350,8 @@ int uclass_next_device(struct udevice **devp); /** * uclass_first_device_err() - Get the first device in a uclass * - * The device returned is probed if necessary, and ready for use + * The device returned is probed if necessary, and ready for use if no error is + * returned * * @id: Uclass ID to look up * @devp: Returns pointer to the first device in that uclass, or NULL if none @@ -361,7 +362,8 @@ int uclass_first_device_err(enum uclass_id id, struct udevice **devp); /** * uclass_next_device_err() - Get the next device in a uclass * - * The device returned is probed if necessary, and ready for use + * The device returned is probed if necessary, and ready for use if no error is + * returned * * @devp: On entry, pointer to device to lookup. On exit, returns pointer * to the next device in the uclass if no error occurred, or NULL if @@ -373,7 +375,8 @@ int uclass_next_device_err(struct udevice **devp); /** * uclass_first_device_check() - Get the first device in a uclass * - * The device returned is probed if necessary, and ready for use + * The device returned is probed if necessary, and ready for use if no error is + * returned * * This function is useful to start iterating through a list of devices which * are functioning correctly and can be probed. @@ -389,7 +392,8 @@ int uclass_first_device_check(enum uclass_id id, struct udevice **devp); /** * uclass_next_device_check() - Get the next device in a uclass * - * The device returned is probed if necessary, and ready for use + * The device returned is probed if necessary, and ready for use if no error is + * returned * * This function is useful to start iterating through a list of devices which * are functioning correctly and can be probed. -- cgit v1.2.3 From 73f8fbc532c3546dd4bf6f267e530a82f04703fa Mon Sep 17 00:00:00 2001 From: Michal Suchanek Date: Tue, 27 Sep 2022 23:24:36 +0200 Subject: dm: core: Document return value of device bind functions These functions use device_bind_with_driver_data internally, copy the return value description. Signed-off-by: Michal Suchanek --- include/dm/lists.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/dm/lists.h b/include/dm/lists.h index fc3b4ae5850..97236f8fa0d 100644 --- a/include/dm/lists.h +++ b/include/dm/lists.h @@ -73,6 +73,7 @@ int lists_bind_fdt(struct udevice *parent, ofnode node, struct udevice **devp, * @drv_name: Name of driver to attach to this parent * @dev_name: Name of the new device thus created * @devp: If non-NULL, returns the newly bound device + * Return: 0 if OK, -ve on error */ int device_bind_driver(struct udevice *parent, const char *drv_name, const char *dev_name, struct udevice **devp); @@ -88,6 +89,7 @@ int device_bind_driver(struct udevice *parent, const char *drv_name, * @dev_name: Name of the new device thus created * @node: Device tree node * @devp: If non-NULL, returns the newly bound device + * Return: 0 if OK, -ve on error */ int device_bind_driver_to_node(struct udevice *parent, const char *drv_name, const char *dev_name, ofnode node, -- cgit v1.2.3 From aa5511e77b8bd8f943c66b6403896d06083b1d92 Mon Sep 17 00:00:00 2001 From: Michal Suchanek Date: Tue, 27 Sep 2022 23:25:08 +0200 Subject: dm: core: Add note about device_probe idempotence device_probe returns early when the device is already activated. Add a note to the documentation that it can be used on already activated devices. Signed-off-by: Michal Suchanek --- include/dm/device-internal.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/dm/device-internal.h b/include/dm/device-internal.h index 94844d30d85..f31c4702086 100644 --- a/include/dm/device-internal.h +++ b/include/dm/device-internal.h @@ -184,8 +184,8 @@ int device_of_to_plat(struct udevice *dev); /** * device_probe() - Probe a device, activating it * - * Activate a device so that it is ready for use. All its parents are probed - * first. + * Activate a device (if not yet activated) so that it is ready for use. + * All its parents are probed first. * * @dev: Pointer to device to probe * Return: 0 if OK, -ve on error -- cgit v1.2.3 From f21954750aa8ed445ab83998bb099e366136c428 Mon Sep 17 00:00:00 2001 From: Michal Suchanek Date: Wed, 12 Oct 2022 21:58:09 +0200 Subject: dm: core: Do not stop uclass iteration on error When probing a device fails NULL pointer is returned, and following devices in uclass list cannot be iterated. Skip to next device on error instead. With that the only condition under which these simple iteration functions return error is when the dm is not initialized at uclass_get time. This is not all that interesting, change return type to void. Fixes: 6494d708bf ("dm: Add base driver model support") Signed-off-by: Michal Suchanek Reviewed-by: Simon Glass --- include/dm/uclass.h | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'include') diff --git a/include/dm/uclass.h b/include/dm/uclass.h index b1c016ef9f5..ee15c920633 100644 --- a/include/dm/uclass.h +++ b/include/dm/uclass.h @@ -320,32 +320,31 @@ int uclass_get_device_by_driver(enum uclass_id id, const struct driver *drv, * uclass_first_device() - Get the first device in a uclass * * The device returned is probed if necessary, and ready for use + * Devices that fail to probe are skipped * * This function is useful to start iterating through a list of devices which * are functioning correctly and can be probed. * * @id: Uclass ID to look up * @devp: Returns pointer to the first device in that uclass if no error - * occurred, or NULL if there is no first device, or an error occurred with - * that device. - * Return: 0 if OK (found or not found), other -ve on error + * occurred, or NULL if there is no usable device */ -int uclass_first_device(enum uclass_id id, struct udevice **devp); +void uclass_first_device(enum uclass_id id, struct udevice **devp); /** * uclass_next_device() - Get the next device in a uclass * * The device returned is probed if necessary, and ready for use + * Devices that fail to probe are skipped * * This function is useful to iterate through a list of devices which * are functioning correctly and can be probed. * * @devp: On entry, pointer to device to lookup. On exit, returns pointer * to the next device in the uclass if no error occurred, or NULL if there is - * no next device, or an error occurred with that next device. - * Return: 0 if OK (found or not found), other -ve on error + * no next device */ -int uclass_next_device(struct udevice **devp); +void uclass_next_device(struct udevice **devp); /** * uclass_first_device_err() - Get the first device in a uclass -- cgit v1.2.3