projects
/
oweals
/
u-boot.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
dm: spi: Return 0 if driver does not implement ops->cs_info
[oweals/u-boot.git]
/
cmd
/
jffs2.c
diff --git
a/cmd/jffs2.c
b/cmd/jffs2.c
index f00d53a6c8331f80e18633f882e8722369bef10d..b47cd3d98930a4a80ee4fbdc55d4afaad036c795 100644
(file)
--- a/
cmd/jffs2.c
+++ b/
cmd/jffs2.c
@@
-1,3
+1,4
@@
+// SPDX-License-Identifier: GPL-2.0+
/*
* (C) Copyright 2002
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
/*
* (C) Copyright 2002
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
@@
-17,8
+18,6
@@
*
* $Id: cmdlinepart.c,v 1.17 2004/11/26 11:18:47 lavinen Exp $
* Copyright 2002 SYSGO Real-Time Solutions GmbH
*
* $Id: cmdlinepart.c,v 1.17 2004/11/26 11:18:47 lavinen Exp $
* Copyright 2002 SYSGO Real-Time Solutions GmbH
- *
- * SPDX-License-Identifier: GPL-2.0+
*/
/*
*/
/*
@@
-73,6
+72,7
@@
*/
#include <common.h>
#include <command.h>
*/
#include <common.h>
#include <command.h>
+#include <env.h>
#include <malloc.h>
#include <jffs2/jffs2.h>
#include <linux/list.h>
#include <malloc.h>
#include <jffs2/jffs2.h>
#include <linux/list.h>
@@
-80,7
+80,7
@@
#include <cramfs/cramfs_fs.h>
#if defined(CONFIG_CMD_NAND)
#include <cramfs/cramfs_fs.h>
#if defined(CONFIG_CMD_NAND)
-#include <linux/mtd/nand.h>
+#include <linux/mtd/
raw
nand.h>
#include <nand.h>
#endif
#include <nand.h>
#endif
@@
-166,8
+166,9
@@
static int mtd_device_validate(u8 type, u8 num, u32 *size)
#endif
} else if (type == MTD_DEV_TYPE_NAND) {
#if defined(CONFIG_JFFS2_NAND) && defined(CONFIG_CMD_NAND)
#endif
} else if (type == MTD_DEV_TYPE_NAND) {
#if defined(CONFIG_JFFS2_NAND) && defined(CONFIG_CMD_NAND)
- if (num < CONFIG_SYS_MAX_NAND_DEVICE) {
- *size = nand_info[num]->size;
+ struct mtd_info *mtd = get_nand_dev_by_index(num);
+ if (mtd) {
+ *size = mtd->size;
return 0;
}
return 0;
}
@@
-244,7
+245,7
@@
static inline u32 get_part_sector_size_nand(struct mtdids *id)
#if defined(CONFIG_JFFS2_NAND) && defined(CONFIG_CMD_NAND)
struct mtd_info *mtd;
#if defined(CONFIG_JFFS2_NAND) && defined(CONFIG_CMD_NAND)
struct mtd_info *mtd;
- mtd =
nand_info[id->num]
;
+ mtd =
get_nand_dev_by_index(id->num)
;
return mtd->erasesize;
#else
return mtd->erasesize;
#else
@@
-478,9
+479,9
@@
int do_jffs2_fsload(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
ulong offset = load_addr;
/* pre-set Boot file name */
ulong offset = load_addr;
/* pre-set Boot file name */
- if ((filename = getenv("bootfile")) == NULL) {
+ filename = env_get("bootfile");
+ if (!filename)
filename = "uImage";
filename = "uImage";
- }
if (argc == 2) {
filename = argv[1];
if (argc == 2) {
filename = argv[1];
@@
-511,7
+512,7
@@
int do_jffs2_fsload(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
if (size > 0) {
printf("### %s load complete: %d bytes loaded to 0x%lx\n",
fsname, size, offset);
if (size > 0) {
printf("### %s load complete: %d bytes loaded to 0x%lx\n",
fsname, size, offset);
-
setenv
_hex("filesize", size);
+
env_set
_hex("filesize", size);
} else {
printf("### %s LOAD ERROR<%x> for %s!\n", fsname, size, filename);
}
} else {
printf("### %s LOAD ERROR<%x> for %s!\n", fsname, size, filename);
}
@@
-606,7
+607,7
@@
U_BOOT_CMD(
" with offset 'off'"
);
U_BOOT_CMD(
" with offset 'off'"
);
U_BOOT_CMD(
-
ls,
2, 1, do_jffs2_ls,
+
fsls,
2, 1, do_jffs2_ls,
"list files in a directory (default /)",
"[ directory ]"
);
"list files in a directory (default /)",
"[ directory ]"
);