]> git.ozlabs.org Git - petitboot/blobdiff - lib/flash/flash.c
discover: Add platform-dummy
[petitboot] / lib / flash / flash.c
index 1384118a59ec0e87befbf3e6f558032f6591b669..b7e5b88b95684f737eeaa4366cda298387c046c1 100644 (file)
@@ -36,7 +36,7 @@ struct flash_info {
        /* Device information */
        struct blocklevel_device        *bl;
        struct ffs_handle               *ffs;
-       uint32_t                        size;   /* raw size of partition */
+       uint64_t                        size;   /* raw size of partition */
        const char                      *path;
        bool                            ecc;
        uint32_t                        erase_granule;
@@ -94,7 +94,7 @@ static struct flash_info *flash_setup_buffer(void *ctx, const char *partition)
 
        rc = ffs_init(0, info->size, info->bl, &info->ffs, 1);
        if (rc) {
-               pb_log("%s: Failed to init ffs\n", __func__);
+               pb_log_fn("Failed to init ffs\n");
                goto out_flash;
        }
 
@@ -124,7 +124,7 @@ static struct flash_info *flash_setup_buffer(void *ctx, const char *partition)
 
        pb_debug("%s Details\n", partition);
        pb_debug("\tName\t\t%s\n", info->path);
-       pb_debug("\tFlash Size\t%u\n", info->size);
+       pb_debug("\tFlash Size\t%lu\n", info->size);
        pb_debug("\tGranule\t\t%u\n", info->erase_granule);
        pb_debug("\tECC\t\t%s\n", info->ecc ? "Protected" : "Unprotected");
        pb_debug("\tCurrent Side info:\n");
@@ -171,7 +171,7 @@ int flash_parse_version(void *ctx, char ***versions, bool current)
        len = cur_info->attr_data_len -  ecc_size(cur_info->attr_data_len);
        buffer = talloc_array(cur_info, char, len);
        if (!buffer) {
-               pb_log("%s: Failed to init buffer!\n", __func__);
+               pb_log_fn("Failed to init buffer!\n");
                goto out;
        }
 
@@ -187,7 +187,7 @@ int flash_parse_version(void *ctx, char ***versions, bool current)
        if (tok) {
                tmp = talloc_realloc(ctx, tmp, char *, n + 1);
                if (!tmp) {
-                       pb_log("%s: Failed to allocate memory\n", __func__);
+                       pb_log_fn("Failed to allocate memory\n");
                        goto out;
                }
                tmp[n++] = talloc_strdup(ctx, tok);
@@ -198,7 +198,7 @@ int flash_parse_version(void *ctx, char ***versions, bool current)
                /* Ignore leading tab from subsequent lines */
                tmp = talloc_realloc(ctx, tmp, char *, n + 1);
                if (!tmp) {
-                       pb_log("%s: Failed to reallocate memory\n", __func__);
+                       pb_log_fn("Failed to reallocate memory\n");
                        n = 0;
                        goto out;
                }