summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2017-08-21 07:16:56 -0400
committerTom Rini <[email protected]>2017-08-21 07:16:56 -0400
commit09b6a6dd010cad18ef1cea2cf579244f0fd17ce4 (patch)
tree2c527aa1bc458d76f4565592bee72c9c7f2a0327 /common
parent8197d92843952b376915fdbcbf67c723feab1532 (diff)
parent5bf4475f1d7726541edec0060c6461fbb37db02d (diff)
Merge git://git.denx.de/u-boot-usb
Diffstat (limited to 'common')
-rw-r--r--common/fb_mmc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/common/fb_mmc.c b/common/fb_mmc.c
index 5065ad5f73b..26d60b88d0c 100644
--- a/common/fb_mmc.c
+++ b/common/fb_mmc.c
@@ -132,7 +132,7 @@ static lbaint_t fb_mmc_get_boot_header(struct blk_desc *dev_desc,
/* Read the boot image header */
res = blk_dread(dev_desc, info->start, hdr_sectors, (void *)hdr);
- if (res == 0) {
+ if (res != hdr_sectors) {
error("cannot read header from boot partition");
fastboot_fail("cannot read header from boot partition");
return 0;
@@ -162,7 +162,7 @@ static int fb_mmc_update_zimage(struct blk_desc *dev_desc,
void *download_buffer,
unsigned int download_bytes)
{
- u32 hdr_addr; /* boot image header address */
+ uintptr_t hdr_addr; /* boot image header address */
struct andr_img_hdr *hdr; /* boot image header */
lbaint_t hdr_sectors; /* boot image header sectors */
u8 *ramdisk_buffer;
@@ -185,7 +185,7 @@ static int fb_mmc_update_zimage(struct blk_desc *dev_desc,
}
/* Put boot image header in fastboot buffer after downloaded zImage */
- hdr_addr = (u32)download_buffer + ALIGN(download_bytes, PAGE_SIZE);
+ hdr_addr = (uintptr_t)download_buffer + ALIGN(download_bytes, PAGE_SIZE);
hdr = (struct andr_img_hdr *)hdr_addr;
/* Read boot image header */
@@ -215,7 +215,7 @@ static int fb_mmc_update_zimage(struct blk_desc *dev_desc,
ramdisk_buffer = (u8 *)hdr + (hdr_sectors * info.blksz);
res = blk_dread(dev_desc, ramdisk_sector_start, ramdisk_sectors,
ramdisk_buffer);
- if (res == 0) {
+ if (res != ramdisk_sectors) {
error("cannot read ramdisk from boot partition");
fastboot_fail("cannot read ramdisk from boot partition");
return -1;