From c565766f01db9ae27035c5f48231939ec5e053ef Mon Sep 17 00:00:00 2001 From: Ahmad Fatoum Date: Thu, 8 Jun 2023 15:40:40 +0200 Subject: of: change superfluous of_fix_tree int return type to void of_fix_tree always returns 0, so propagating its return code and checking it serves no purpose. Let's just change it to void *. I considered having it return the first argument, but that could mislead users to think that the argument is not modified. Signed-off-by: Ahmad Fatoum Link: https://lore.barebox.org/20230608134040.2123869-2-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer --- commands/of_compatible.c | 7 ++----- commands/of_dump.c | 7 ++----- common/oftree.c | 10 ++-------- include/of.h | 2 +- 4 files changed, 7 insertions(+), 19 deletions(-) diff --git a/commands/of_compatible.c b/commands/of_compatible.c index b460fecd3a..d8704d50bb 100644 --- a/commands/of_compatible.c +++ b/commands/of_compatible.c @@ -57,11 +57,8 @@ static int do_of_compatible(int argc, char *argv[]) root = of_free = of_dup(root); } - if (fix) { - ret = of_fix_tree(root); - if (ret) - goto out; - } + if (fix) + of_fix_tree(root); node = of_find_node_by_path_or_alias(root, nodename); if (!node) { diff --git a/commands/of_dump.c b/commands/of_dump.c index 1d6c019bf0..c77dc27c99 100644 --- a/commands/of_dump.c +++ b/commands/of_dump.c @@ -84,11 +84,8 @@ static int do_of_dump(int argc, char *argv[]) root = of_free = of_dup(root); } - if (fix) { - ret = of_fix_tree(root); - if (ret) - goto out; - } + if (fix) + of_fix_tree(root); node = of_find_node_by_path_or_alias(root, nodename); if (!node) { diff --git a/common/oftree.c b/common/oftree.c index 1f751cc0ac..620de6ed56 100644 --- a/common/oftree.c +++ b/common/oftree.c @@ -392,7 +392,7 @@ int of_unregister_fixup(int (*fixup)(struct device_node *, void *), * Apply registered fixups for the given fdt. The fdt must have * enough free space to apply the fixups. */ -int of_fix_tree(struct device_node *node) +void of_fix_tree(struct device_node *node) { struct of_fixup *of_fixup; int ret; @@ -408,8 +408,6 @@ int of_fix_tree(struct device_node *node) pr_warn("Failed to fixup node in %pS: %s\n", of_fixup->fixup, strerror(-ret)); } - - return 0; } /* @@ -420,7 +418,6 @@ int of_fix_tree(struct device_node *node) */ struct fdt_header *of_get_fixed_tree(struct device_node *node) { - int ret; struct fdt_header *fdt = NULL; struct device_node *freenp = NULL; @@ -434,13 +431,10 @@ struct fdt_header *of_get_fixed_tree(struct device_node *node) return NULL; } - ret = of_fix_tree(node); - if (ret) - goto out; + of_fix_tree(node); fdt = of_flatten_dtb(node); -out: of_delete_node(freenp); return fdt; diff --git a/include/of.h b/include/of.h index c716f92833..f895534837 100644 --- a/include/of.h +++ b/include/of.h @@ -65,7 +65,7 @@ struct device; struct driver; struct resource; -int of_fix_tree(struct device_node *); +void of_fix_tree(struct device_node *); int of_match(struct device *dev, struct driver *drv); -- cgit v1.2.3