summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2023-06-08 15:40:40 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2023-06-09 08:41:45 +0200
commitc565766f01db9ae27035c5f48231939ec5e053ef (patch)
tree98f7d9758f975ccda6cc825f6349912689a74f6c
parentbf7405c00016beb7860729d18d4fe53772b81db7 (diff)
downloadbarebox-c565766f01db9ae27035c5f48231939ec5e053ef.tar.gz
barebox-c565766f01db9ae27035c5f48231939ec5e053ef.tar.xz
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 <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230608134040.2123869-2-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--commands/of_compatible.c7
-rw-r--r--commands/of_dump.c7
-rw-r--r--common/oftree.c10
-rw-r--r--include/of.h2
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);