X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=common%2Fcmd_bmp.c;h=5a52edde31dff8c4083baa449302ffab1b906cb4;hb=d54097b6c10aab68dd0a88ec0d5c86615d3dd597;hp=5ec798c549afb5fb1d9102b310595bc9a777ab21;hpb=54841ab50c20d6fa6c9cc3eb826989da3a22d934;p=u-boot diff --git a/common/cmd_bmp.c b/common/cmd_bmp.c index 5ec798c549..5a52edde31 100644 --- a/common/cmd_bmp.c +++ b/common/cmd_bmp.c @@ -31,9 +31,9 @@ #include #include #include +#include static int bmp_info (ulong addr); -static int bmp_display (ulong addr, int x, int y); /* * Allocate and decompress a BMP image using gunzip(). @@ -79,7 +79,7 @@ bmp_image_t *gunzip_bmp(unsigned long addr, unsigned long *lenp) return NULL; } - puts("Gzipped BMP image detected!\n"); + debug("Gzipped BMP image detected!\n"); return bmp; } @@ -102,8 +102,7 @@ static int do_bmp_info(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[ addr = simple_strtoul(argv[1], NULL, 16); break; default: - cmd_usage(cmdtp); - return 1; + return CMD_RET_USAGE; } return (bmp_info(addr)); @@ -127,8 +126,7 @@ static int do_bmp_display(cmd_tbl_t * cmdtp, int flag, int argc, char * const ar y = simple_strtoul(argv[3], NULL, 10); break; default: - cmd_usage(cmdtp); - return 1; + return CMD_RET_USAGE; } return (bmp_display(addr, x, y)); @@ -139,6 +137,12 @@ static cmd_tbl_t cmd_bmp_sub[] = { U_BOOT_CMD_MKENT(display, 5, 0, do_bmp_display, "", ""), }; +#ifdef CONFIG_NEEDS_MANUAL_RELOC +void bmp_reloc(void) { + fixup_cmdtable(cmd_bmp_sub, ARRAY_SIZE(cmd_bmp_sub)); +} +#endif + /* * Subroutine: do_bmp * @@ -159,12 +163,10 @@ static int do_bmp(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) c = find_cmd_tbl(argv[0], &cmd_bmp_sub[0], ARRAY_SIZE(cmd_bmp_sub)); - if (c) { + if (c) return c->cmd(cmdtp, flag, argc, argv); - } else { - cmd_usage(cmdtp); - return 1; - } + else + return CMD_RET_USAGE; } U_BOOT_CMD( @@ -219,7 +221,7 @@ static int bmp_info(ulong addr) * Return: None * */ -static int bmp_display(ulong addr, int x, int y) +int bmp_display(ulong addr, int x, int y) { int ret; bmp_image_t *bmp = (bmp_image_t *)addr; @@ -235,13 +237,9 @@ static int bmp_display(ulong addr, int x, int y) } #if defined(CONFIG_LCD) - extern int lcd_display_bitmap (ulong, int, int); - - ret = lcd_display_bitmap ((unsigned long)bmp, x, y); + ret = lcd_display_bitmap((ulong)bmp, x, y); #elif defined(CONFIG_VIDEO) - extern int video_display_bitmap (ulong, int, int); - - ret = video_display_bitmap ((unsigned long)bmp, x, y); + ret = video_display_bitmap((unsigned long)bmp, x, y); #else # error bmp_display() requires CONFIG_LCD or CONFIG_VIDEO #endif