mtdconfig: lomtdconfig device change to depends on !MTD_CONFIG_NONE

Because  MTD_CONFIG configuration item in drivers/mtd/Kconfig
has changed.

Signed-off-by: zhaoxingyu1 <zhaoxingyu1@xiaomi.com>
This commit is contained in:
zhaoxingyu1 2025-06-03 17:33:16 +08:00 committed by Donny(董九柱)
parent 102c078834
commit d9d434d97e
2 changed files with 5 additions and 5 deletions

View file

@ -322,7 +322,7 @@ static const struct cmdmap_s g_cmdmap[] =
#ifndef CONFIG_DISABLE_MOUNTPOINT
# if defined(CONFIG_MTD_LOOP) && !defined(CONFIG_NSH_DISABLE_LOMTD)
# ifdef CONFIG_MTD_CONFIG
# ifndef CONFIG_MTD_CONFIG_NONE
CMD_MAP("lomtd", cmd_lomtd, 3, 10,
"[-d <dev-path>] | [[-o <offset>] [-e <erase-size>] "
"[-b <sect-size>] [-c <configdata>] <dev-path> <file-path>]]"),

View file

@ -1308,7 +1308,7 @@ int cmd_lomtd(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv)
int sectsize = -1;
off_t offset = 0;
bool badarg = false;
# ifdef CONFIG_MTD_CONFIG
# ifndef CONFIG_MTD_CONFIG_NONE
int configdata = 0;
# endif
int ret = ERROR;
@ -1324,7 +1324,7 @@ int cmd_lomtd(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv)
* NOTE that the -o and -r options are accepted with the -d option, but
* will be ignored.
*/
# ifdef CONFIG_MTD_CONFIG
# ifndef CONFIG_MTD_CONFIG_NONE
while ((option = getopt(argc, argv, "d:o:e:b:c:")) != ERROR)
# else
while ((option = getopt(argc, argv, "d:o:e:b:")) != ERROR)
@ -1349,7 +1349,7 @@ int cmd_lomtd(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv)
sectsize = atoi(optarg);
break;
# ifdef CONFIG_MTD_CONFIG
# ifndef CONFIG_MTD_CONFIG_NONE
case 'c':
configdata = atoi(optarg);
break;
@ -1435,7 +1435,7 @@ int cmd_lomtd(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv)
setup.sectsize = sectsize; /* The sector size to use with the block device */
setup.erasesize = erasesize; /* The sector size to use with the block device */
setup.offset = offset; /* An offset that may be applied to the device */
# ifdef CONFIG_MTD_CONFIG
# ifndef CONFIG_MTD_CONFIG_NONE
setup.configdata = configdata; /* Is a loop mtdconfig device */
# endif