]> git.sur5r.net Git - u-boot/blobdiff - common/fb_mmc.c
dm: core: add clocks node scan
[u-boot] / common / fb_mmc.c
index 2113b6c3723978f31372e1562010e76defb6f800..26d60b88d0cad12e5fa6bf8f0753be757f8c75f6 100644 (file)
@@ -49,7 +49,7 @@ static int part_get_info_by_name_or_alias(struct blk_desc *dev_desc,
                /* check for alias */
                strcpy(env_alias_name, "fastboot_partition_alias_");
                strncat(env_alias_name, name, 32);
-               aliased_part_name = getenv(env_alias_name);
+               aliased_part_name = env_get(env_alias_name);
                if (aliased_part_name != NULL)
                        ret = part_get_info_by_name(dev_desc,
                                        aliased_part_name, info);
@@ -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;