mkimage: Honour the default image type with auto-fit
authorSimon Glass <sjg@chromium.org>
Thu, 30 Jun 2016 16:52:07 +0000 (10:52 -0600)
committerTom Rini <trini@konsulko.com>
Thu, 14 Jul 2016 22:22:26 +0000 (18:22 -0400)
The default image type is supposed to be IH_TYPE_KERNEL, as set in the
'params' variable. Honour this with auto-fit also.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
tools/mkimage.c

index ff3024a8f172c8557bfaa02612d995bdcdd04f2d..53fa8bb3a8f048a6f9516780218ac18b00d57a40 100644 (file)
@@ -272,7 +272,7 @@ static void process_args(int argc, char **argv)
         * will always be IH_TYPE_FLATDT in this case).
         */
        if (params.type == IH_TYPE_FLATDT) {
-               params.fit_image_type = type;
+               params.fit_image_type = type ? type : IH_TYPE_KERNEL;
                if (!params.auto_its)
                        params.datafile = datafile;
        } else if (type != IH_TYPE_INVALID) {