diff options
author | Simon Glass <sjg@chromium.org> | 2021-10-14 12:47:57 -0600 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2021-11-11 19:02:14 -0500 |
commit | b1ead6b9087f1f96cb117d72e3e5cf0d5fb708f5 (patch) | |
tree | f25a8c8de5539f31d9fb5688ce3d0f10d41cad2e /cmd/pxe_utils.c | |
parent | fd3fa5c3941d4de0736d066f77d0158cf933e207 (diff) | |
download | u-boot-b1ead6b9087f1f96cb117d72e3e5cf0d5fb708f5.zip u-boot-b1ead6b9087f1f96cb117d72e3e5cf0d5fb708f5.tar.gz u-boot-b1ead6b9087f1f96cb117d72e3e5cf0d5fb708f5.tar.bz2 |
pxe: Move do_getfile() into the context
Rather than having a global variable, pass the function as part of the
context.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Artem Lapkin <email2tema@gmail.com>
Tested-by: Artem Lapkin <email2tema@gmail.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Diffstat (limited to 'cmd/pxe_utils.c')
-rw-r--r-- | cmd/pxe_utils.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/cmd/pxe_utils.c b/cmd/pxe_utils.c index 9983c86..c65f1ea 100644 --- a/cmd/pxe_utils.c +++ b/cmd/pxe_utils.c @@ -94,9 +94,6 @@ static int get_bootfile_path(const char *file_path, char *bootfile_path, return 1; } -int (*do_getfile)(struct cmd_tbl *cmdtp, const char *file_path, - char *file_addr); - /* * As in pxelinux, paths to files referenced from files we retrieve are * relative to the location of bootfile. get_relfile takes such a path and @@ -133,7 +130,7 @@ static int get_relfile(struct pxe_context *ctx, const char *file_path, sprintf(addr_buf, "%lx", file_addr); - return do_getfile(ctx->cmdtp, relfile, addr_buf); + return ctx->getfile(ctx, relfile, addr_buf); } int get_pxe_file(struct pxe_context *ctx, const char *file_path, @@ -1453,7 +1450,9 @@ void handle_pxe_menu(struct pxe_context *ctx, struct pxe_menu *cfg) boot_unattempted_labels(ctx, cfg); } -void pxe_setup_ctx(struct pxe_context *ctx, struct cmd_tbl *cmdtp) +void pxe_setup_ctx(struct pxe_context *ctx, struct cmd_tbl *cmdtp, + pxe_getfile_func getfile) { ctx->cmdtp = cmdtp; + ctx->getfile = getfile; } |