]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - common/splash_source.c
env: Rename getenv/_f() to env_get()
[people/ms/u-boot.git] / common / splash_source.c
index 4c64f10c500ab2e0826f3537ee65a6c8d552f36c..8c0ac581f7309f5bbf780970646e28e138e08a3f 100644 (file)
@@ -47,9 +47,10 @@ static int splash_sf_read_raw(u32 bmp_load_addr, int offset, size_t read_size)
 #ifdef CONFIG_CMD_NAND
 static int splash_nand_read_raw(u32 bmp_load_addr, int offset, size_t read_size)
 {
-       return nand_read_skip_bad(nand_info[nand_curr_device], offset,
+       struct mtd_info *mtd = get_nand_dev_by_index(nand_curr_device);
+       return nand_read_skip_bad(mtd, offset,
                                  &read_size, NULL,
-                                 nand_info[nand_curr_device]->size,
+                                 mtd->size,
                                  (u_char *)bmp_load_addr);
 }
 #else
@@ -162,7 +163,7 @@ static inline int splash_init_usb(void)
 }
 #endif
 
-#ifdef CONFIG_CMD_SATA
+#ifdef CONFIG_SATA
 static int splash_init_sata(void)
 {
        return sata_initialize();
@@ -216,9 +217,10 @@ static int splash_load_fs(struct splash_location *location, u32 bmp_load_addr)
 {
        int res = 0;
        loff_t bmp_size;
+       loff_t actread;
        char *splash_file;
 
-       splash_file = getenv("splashfile");
+       splash_file = env_get("splashfile");
        if (!splash_file)
                splash_file = SPLASH_SOURCE_DEFAULT_FILE_NAME;
 
@@ -251,7 +253,7 @@ static int splash_load_fs(struct splash_location *location, u32 bmp_load_addr)
        }
 
        splash_select_fs_dev(location);
-       res = fs_read(splash_file, bmp_load_addr, 0, 0, NULL);
+       res = fs_read(splash_file, bmp_load_addr, 0, 0, &actread);
 
 out:
        if (location->ubivol != NULL)
@@ -284,7 +286,7 @@ static struct splash_location *select_splash_location(
        if (!locations || size == 0)
                return NULL;
 
-       env_splashsource = getenv("splashsource");
+       env_splashsource = env_get("splashsource");
        if (env_splashsource == NULL)
                return &locations[0];
 
@@ -381,7 +383,7 @@ int splash_source_load(struct splash_location *locations, uint size)
        char *env_splashimage_value;
        u32 bmp_load_addr;
 
-       env_splashimage_value = getenv("splashimage");
+       env_splashimage_value = env_get("splashimage");
        if (env_splashimage_value == NULL)
                return -ENOENT;
 
@@ -395,9 +397,9 @@ int splash_source_load(struct splash_location *locations, uint size)
        if (!splash_location)
                return -EINVAL;
 
-       if (splash_location->flags & SPLASH_STORAGE_RAW)
+       if (splash_location->flags == SPLASH_STORAGE_RAW)
                return splash_load_raw(splash_location, bmp_load_addr);
-       else if (splash_location->flags & SPLASH_STORAGE_FS)
+       else if (splash_location->flags == SPLASH_STORAGE_FS)
                return splash_load_fs(splash_location, bmp_load_addr);
 #ifdef CONFIG_FIT
        else if (splash_location->flags == SPLASH_STORAGE_FIT)