]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - board/cm5200/fwupdate.c
dm: part: Rename some partition functions
[people/ms/u-boot.git] / board / cm5200 / fwupdate.c
index e963eb553f0f4b092b8c9f0c9211c29fe8ba48e9..2ed90de9d529d41c01bafec0c6ec92407eb97729 100644 (file)
@@ -7,11 +7,12 @@
  *   - code clean-up
  *   - bugfix for overwriting bootargs by user
  *
- * SPDX-License-Identifier:    GPL-2.0+ 
+ * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
 #include <command.h>
+#include <fat.h>
 #include <malloc.h>
 #include <image.h>
 #include <usb.h>
@@ -19,9 +20,6 @@
 
 #include "fwupdate.h"
 
-extern long do_fat_read(const char *, void *, unsigned long, int);
-extern int do_fat_fsload(cmd_tbl_t *, int, int, char * const []);
-
 static int load_rescue_image(ulong);
 
 void cm5200_fwupdate(void)
@@ -83,7 +81,7 @@ static int load_rescue_image(ulong addr)
        char dev[7];
        char addr_str[16];
        char * const argv[6] = { "fatload", "usb", dev, addr_str, nxri, NULL };
-       block_dev_desc_t *stor_dev = NULL;
+       struct blk_desc *stor_dev = NULL;
        cmd_tbl_t *bcmd;
 
        /* Get name of firmware directory */
@@ -119,12 +117,12 @@ static int load_rescue_image(ulong addr)
 
        /* Detect partition */
        for (partno = -1, i = 0; i < 6; i++) {
-               if (get_partition_info(stor_dev, i, &info) == 0) {
+               if (part_get_info(stor_dev, i, &info) == 0) {
                        if (fat_register_device(stor_dev, i) == 0) {
                                /* Check if rescue image is present */
                                FW_DEBUG("Looking for firmware directory '%s'"
                                        " on partition %d\n", fwdir, i);
-                               if (do_fat_read(fwdir, NULL, 0, LS_NO) == -1) {
+                               if (!fat_exists(fwdir)) {
                                        FW_DEBUG("No NX rescue image on "
                                                "partition %d.\n", i);
                                        partno = -2;