summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2012-12-07 16:43:24 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2012-12-07 16:43:24 +0100
commite7509bfbabc46e15e66193efac64440b48e5e88f (patch)
treef271f8c83584333fe49d4f94127d4de40119f55a
parent8f32824c6e374092f3c1dec431e5e83f839353fe (diff)
parentbd2fce751d4a2b8170962b53646209d6e14c7495 (diff)
downloadbarebox-e7509bfbabc46e15e66193efac64440b48e5e88f.tar.gz
barebox-e7509bfbabc46e15e66193efac64440b48e5e88f.tar.xz
Merge branch 'for-next/tftp'
-rw-r--r--common/uimage.c24
1 files changed, 0 insertions, 24 deletions
diff --git a/common/uimage.c b/common/uimage.c
index 3bec6b39f8..1ac0b7dc42 100644
--- a/common/uimage.c
+++ b/common/uimage.c
@@ -28,8 +28,6 @@
#include <rtc.h>
#include <filetype.h>
#include <memory.h>
-#include <linux/stat.h>
-#include <sizes.h>
#ifdef CONFIG_UIMAGE_MULTI
static inline int uimage_is_multi_image(struct uimage_handle *handle)
@@ -384,33 +382,11 @@ struct resource *file_to_sdram(const char *filename, unsigned long adr)
size_t ofs = 0;
size_t now;
int fd;
- struct stat s;
fd = open(filename, O_RDONLY);
if (fd < 0)
return NULL;
- /* TODO: use fstat(fd, &s) when implemented and avoid reopening file */
- if (stat(filename, &s) == 0 && s.st_size <= SZ_1G) {
- /*
- * As the file size is known we can read it at once and improve
- * transfer speed.
- */
- size = s.st_size;
- res = request_sdram_region("image", adr, size);
- if (!res) {
- printf("unable to request SDRAM 0x%08lx-0x%08lx\n",
- adr, adr + size - 1);
- goto out;
- }
-
- now = read_full(fd, (void *)(res->start), size);
- if (now < size) {
- release_sdram_region(res);
- res = NULL;
- }
- goto out;
- }
while (1) {
res = request_sdram_region("image", adr, size);
if (!res) {