From fda76b134cccd26507e96724cc55bb83a49a178e Mon Sep 17 00:00:00 2001 From: Michael Tretter Date: Wed, 18 Aug 2021 14:58:48 +0200 Subject: 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 Signed-off-by: Michael Tretter Link: https://lore.barebox.org/20210818125848.560293-1-m.tretter@pengutronix.de Signed-off-by: Sascha Hauer --- arch/arm/mach-zynqmp/zynqmp-bbu.c | 40 +++------------------------------------ 1 file changed, 3 insertions(+), 37 deletions(-) (limited to 'arch/arm/mach-zynqmp') 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 -#include #include -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); } -- cgit v1.2.3