diff options
author | Guilherme Maciel Ferreira <guilherme.maciel.ferreira@gmail.com> | 2015-01-15 02:48:07 -0200 |
---|---|---|
committer | Tom Rini <trini@ti.com> | 2015-01-29 13:38:41 -0500 |
commit | a93648d197df48fa46dd55f925ff70468bd81c71 (patch) | |
tree | 87672e7f6b2132cf992d79dde7bde7a2cc060977 /tools/mkimage.c | |
parent | 067d15607598884e270f3076c721f56d3c4f65e6 (diff) | |
download | u-boot-imx-a93648d197df48fa46dd55f925ff70468bd81c71.zip u-boot-imx-a93648d197df48fa46dd55f925ff70468bd81c71.tar.gz u-boot-imx-a93648d197df48fa46dd55f925ff70468bd81c71.tar.bz2 |
imagetool: replace image registration function by linker_lists feature
The registration was introduced in commit f86ed6a8d52c99bb2d17d3cac1647edca0c4399c
This commit also removes all registration functions, and the member "next"
from image_type_params struct
Signed-off-by: Guilherme Maciel Ferreira <guilherme.maciel.ferreira@gmail.com>
Diffstat (limited to 'tools/mkimage.c')
-rw-r--r-- | tools/mkimage.c | 44 |
1 files changed, 2 insertions, 42 deletions
diff --git a/tools/mkimage.c b/tools/mkimage.c index c04a2ab..f668487 100644 --- a/tools/mkimage.c +++ b/tools/mkimage.c @@ -29,42 +29,6 @@ struct image_tool_params params = { .imagename2 = "", }; -/* - * mkimage_register - - * - * It is used to register respective image generation/list support to the - * mkimage core - * - * the input struct image_type_params is checked and appended to the link - * list, if the input structure is already registered, error - */ -void mkimage_register (struct image_type_params *tparams) -{ - struct image_type_params **tp; - - if (!tparams) { - fprintf (stderr, "%s: %s: Null input\n", - params.cmdname, __FUNCTION__); - exit (EXIT_FAILURE); - } - - /* scan the linked list, check for registry and point the last one */ - for (tp = &mkimage_tparams; *tp != NULL; tp = &(*tp)->next) { - if (!strcmp((*tp)->name, tparams->name)) { - fprintf (stderr, "%s: %s already registered\n", - params.cmdname, tparams->name); - return; - } - } - - /* add input struct entry at the end of link list */ - *tp = tparams; - /* mark input entry as last entry in the link list */ - tparams->next = NULL; - - debug ("Registered %s\n", tparams->name); -} - int main (int argc, char **argv) { @@ -75,9 +39,6 @@ main (int argc, char **argv) struct image_type_params *tparams = NULL; int pad_len = 0; - /* Init all image generation/list support */ - register_image_tool(mkimage_register); - params.cmdname = *argv; params.addr = params.ep = 0; @@ -215,7 +176,7 @@ NXTARG: ; usage (); /* set tparams as per input type_id */ - tparams = imagetool_get_type(params.type, mkimage_tparams); + tparams = imagetool_get_type(params.type); if (tparams == NULL) { fprintf (stderr, "%s: unsupported type %s\n", params.cmdname, genimg_get_type_name(params.type)); @@ -466,8 +427,7 @@ copy_file (int ifd, const char *datafile, int pad) uint8_t zeros[4096]; int offset = 0; int size; - struct image_type_params *tparams = imagetool_get_type(params.type, - mkimage_tparams); + struct image_type_params *tparams = imagetool_get_type(params.type); if (pad >= sizeof(zeros)) { fprintf(stderr, "%s: Can't pad to %d\n", |