summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2021-06-24 10:52:17 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2021-06-25 09:27:07 +0200
commit04e3a8fe4ae82bacd532e4fe91ec7a79260043e1 (patch)
treea67a7453e7179baab446134c964011b9b6ad7a00 /drivers
parent9d43ef0db1ff83f673b7f7a3bc3a0e9c564365b1 (diff)
downloadbarebox-04e3a8fe4ae82bacd532e4fe91ec7a79260043e1.tar.gz
barebox-04e3a8fe4ae82bacd532e4fe91ec7a79260043e1.tar.xz
firmware: Load from global search path
We have a global firmware search path, so use it. This removes the path argument from of_firmware_load_overlay(). blspec already extends the global firmware search path, so the path is not needed there. The of_overlay command has an option for specifying the search path, this is removed here, the global search path has to be used instead. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Link: https://lore.barebox.org/20210624085223.14616-13-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/of/of_firmware.c25
1 files changed, 4 insertions, 21 deletions
diff --git a/drivers/of/of_firmware.c b/drivers/of/of_firmware.c
index 096f84572e..12ce1d95d0 100644
--- a/drivers/of/of_firmware.c
+++ b/drivers/of/of_firmware.c
@@ -6,10 +6,6 @@
#include <firmware.h>
#include <of.h>
-struct overlay_info {
- const char *firmware_path;
-};
-
static struct firmware_mgr *of_node_get_mgr(struct device_node *np)
{
struct device_node *mgr_node;
@@ -26,12 +22,9 @@ static struct firmware_mgr *of_node_get_mgr(struct device_node *np)
}
static int load_firmware(struct device_node *target,
- struct device_node *fragment, void *data)
+ struct device_node *fragment, void *unused)
{
- struct overlay_info *info = data;
const char *firmware_name;
- const char *firmware_path = info->firmware_path;
- char *firmware;
int err;
struct firmware_mgr *mgr;
@@ -50,22 +43,13 @@ static int load_firmware(struct device_node *target,
if (!mgr)
return -EINVAL;
- firmware = basprintf("%s/%s", firmware_path, firmware_name);
- if (!firmware)
- return -ENOMEM;
-
- err = firmwaremgr_load_file(mgr, firmware);
-
- free(firmware);
+ err = firmwaremgr_load_file(mgr, firmware_name);
return err;
}
-int of_firmware_load_overlay(struct device_node *overlay, const char *path)
+int of_firmware_load_overlay(struct device_node *overlay)
{
- struct overlay_info info = {
- .firmware_path = path,
- };
int err;
struct device_node *root;
struct device_node *resolved;
@@ -81,8 +65,7 @@ int of_firmware_load_overlay(struct device_node *overlay, const char *path)
*/
ovl = resolved ? resolved : overlay;
- err = of_process_overlay(root, ovl,
- load_firmware, &info);
+ err = of_process_overlay(root, ovl, load_firmware, NULL);
if (resolved)
of_delete_node(resolved);