summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-zynqmp
diff options
context:
space:
mode:
authorMichael Tretter <m.tretter@pengutronix.de>2021-08-18 14:58:48 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2021-08-23 15:52:39 +0200
commitfda76b134cccd26507e96724cc55bb83a49a178e (patch)
tree09486d78700a23f5bce7032adfca70ae1554e231 /arch/arm/mach-zynqmp
parent2f29ee311f1d9561b446baa5bc9f007420943aa6 (diff)
downloadbarebox-fda76b134cccd26507e96724cc55bb83a49a178e.tar.gz
barebox-fda76b134cccd26507e96724cc55bb83a49a178e.tar.xz
ARM: zynqmp: use std_file_update as update handler
The update handler for zynqmp copies the boot.bin file into an existing fat partition. There is already a better implementation by bbu_register_std_file_update(). Drop the custom implementation. Keep the previous functions with its signature to have an obvious common update handler for all ZynqMP boards. Suggested-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de> Link: https://lore.barebox.org/20210818125848.560293-1-m.tretter@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-zynqmp')
-rw-r--r--arch/arm/mach-zynqmp/zynqmp-bbu.c40
1 files changed, 3 insertions, 37 deletions
diff --git a/arch/arm/mach-zynqmp/zynqmp-bbu.c b/arch/arm/mach-zynqmp/zynqmp-bbu.c
index d1197c01dc..7ac8c2b8a9 100644
--- a/arch/arm/mach-zynqmp/zynqmp-bbu.c
+++ b/arch/arm/mach-zynqmp/zynqmp-bbu.c
@@ -4,45 +4,11 @@
*/
#include <common.h>
-#include <libfile.h>
#include <mach/zynqmp-bbu.h>
-static int zynqmp_bbu_handler(struct bbu_handler *handler,
- struct bbu_data *data)
-{
- int ret = 0;
-
- ret = bbu_confirm(data);
- if (ret)
- return ret;
-
- ret = copy_file(data->imagefile, data->devicefile, 1);
- if (ret < 0) {
- pr_err("update failed: %s", strerror(-ret));
- return ret;
- }
-
- return ret;
-}
-
int zynqmp_bbu_register_handler(const char *name, char *devicefile,
- unsigned long flags)
+ unsigned long flags)
{
- struct bbu_handler *handler;
- int ret = 0;
-
- if (!name || !devicefile)
- return -EINVAL;
-
- handler = xzalloc(sizeof(*handler));
- handler->name = name;
- handler->devicefile = devicefile;
- handler->flags = flags;
- handler->handler = zynqmp_bbu_handler;
-
- ret = bbu_register_handler(handler);
- if (ret)
- free(handler);
-
- return ret;
+ return bbu_register_std_file_update(name, flags, devicefile,
+ filetype_zynq_image);
}