Merge branch 'master' of git://git.denx.de/u-boot-net
[oweals/u-boot.git] / lib / gunzip.c
index 4128a1871c998836dde4bded2c6784d2b1826768..80b157f99eb4844dbade0925b0f20c0850d2bda5 100644 (file)
@@ -8,6 +8,7 @@
 #include <common.h>
 #include <watchdog.h>
 #include <command.h>
+#include <console.h>
 #include <image.h>
 #include <malloc.h>
 #include <u-boot/zlib.h>
@@ -69,6 +70,7 @@ int gunzip(void *dst, int dstlen, unsigned char *src, unsigned long *lenp)
        return zunzip(dst, dstlen, src, lenp, 1, i);
 }
 
+#ifdef CONFIG_CMD_UNZIP
 __weak
 void gzwrite_progress_init(u64 expectedsize)
 {
@@ -230,8 +232,7 @@ int gzwrite(unsigned char *src, int len,
                        gzwrite_progress(iteration++,
                                         totalfilled,
                                         szexpected);
-                       blocks_written = dev->block_write(dev->dev,
-                                                         outblock,
+                       blocks_written = dev->block_write(dev, outblock,
                                                          writeblocks,
                                                          writebuf);
                        outblock += blocks_written;
@@ -258,6 +259,7 @@ out:
 
        return r;
 }
+#endif
 
 /*
  * Uncompress blocks compressed with zlib without headers