summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'cmd')
-rw-r--r--cmd/adc.c9
-rw-r--r--cmd/bootm.c1
-rw-r--r--cmd/cls.c20
-rw-r--r--cmd/cramfs.c2
-rw-r--r--cmd/cros_ec.c1
-rw-r--r--cmd/extension_board.c1
-rw-r--r--cmd/flash.c1
-rw-r--r--cmd/jffs2.c5
-rw-r--r--cmd/load.c2
-rw-r--r--cmd/mem.c2
-rw-r--r--cmd/mvebu/bubt.c1
-rw-r--r--cmd/sf.c1
12 files changed, 21 insertions, 25 deletions
diff --git a/cmd/adc.c b/cmd/adc.c
index 195efa8661..1c5d3e10a3 100644
--- a/cmd/adc.c
+++ b/cmd/adc.c
@@ -71,6 +71,7 @@ static int do_adc_info(struct cmd_tbl *cmdtp, int flag, int argc,
static int do_adc_single(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
{
+ char *varname = NULL;
struct udevice *dev;
unsigned int data;
int ret, uV, val;
@@ -78,6 +79,9 @@ static int do_adc_single(struct cmd_tbl *cmdtp, int flag, int argc,
if (argc < 3)
return CMD_RET_USAGE;
+ if (argc >= 4)
+ varname = argv[3];
+
ret = adc_channel_single_shot(argv[1], simple_strtol(argv[2], NULL, 0),
&data);
if (ret) {
@@ -95,7 +99,8 @@ static int do_adc_single(struct cmd_tbl *cmdtp, int flag, int argc,
printf("%u\n", data);
}
- env_set_ulong(argv[2], val);
+ if (varname)
+ env_set_ulong(varname, val);
return CMD_RET_SUCCESS;
}
@@ -160,5 +165,5 @@ static char adc_help_text[] =
U_BOOT_CMD_WITH_SUBCMDS(adc, "ADC sub-system", adc_help_text,
U_BOOT_SUBCMD_MKENT(list, 1, 1, do_adc_list),
U_BOOT_SUBCMD_MKENT(info, 2, 1, do_adc_info),
- U_BOOT_SUBCMD_MKENT(single, 3, 1, do_adc_single),
+ U_BOOT_SUBCMD_MKENT(single, 4, 1, do_adc_single),
U_BOOT_SUBCMD_MKENT(scan, 3, 1, do_adc_scan));
diff --git a/cmd/bootm.c b/cmd/bootm.c
index 1f70ee9e91..9fe8ce4a27 100644
--- a/cmd/bootm.c
+++ b/cmd/bootm.c
@@ -31,7 +31,6 @@ static int image_info(unsigned long addr);
#if defined(CONFIG_CMD_IMLS)
#include <flash.h>
#include <mtd/cfi_flash.h>
-extern flash_info_t flash_info[]; /* info for FLASH chips */
#endif
#if defined(CONFIG_CMD_IMLS) || defined(CONFIG_CMD_IMLS_NAND)
diff --git a/cmd/cls.c b/cmd/cls.c
index 502d5ed697..ba36220d9e 100644
--- a/cmd/cls.c
+++ b/cmd/cls.c
@@ -8,7 +8,6 @@
#include <common.h>
#include <command.h>
#include <dm.h>
-#include <lcd.h>
#include <video.h>
#define CSI "\x1b["
@@ -20,19 +19,12 @@ static int do_video_clear(struct cmd_tbl *cmdtp, int flag, int argc,
/* Send clear screen and home */
printf(CSI "2J" CSI "1;1H");
-#if defined(CONFIG_DM_VIDEO)
-#if !defined(CONFIG_VIDEO_ANSI)
- if (uclass_first_device_err(UCLASS_VIDEO, &dev))
- return CMD_RET_FAILURE;
-
- if (video_clear(dev))
- return CMD_RET_FAILURE;
-#endif
-#elif defined(CONFIG_LCD)
- lcd_clear();
-#else
- return CMD_RET_FAILURE;
-#endif
+ if (CONFIG_IS_ENABLED(DM_VIDEO) && !CONFIG_IS_ENABLED(VIDEO_ANSI)) {
+ if (uclass_first_device_err(UCLASS_VIDEO, &dev))
+ return CMD_RET_FAILURE;
+ if (video_clear(dev))
+ return CMD_RET_FAILURE;
+ }
return CMD_RET_SUCCESS;
}
diff --git a/cmd/cramfs.c b/cmd/cramfs.c
index 2aad50c672..57e2afa247 100644
--- a/cmd/cramfs.c
+++ b/cmd/cramfs.c
@@ -33,11 +33,11 @@
# define DEBUGF(fmt, args...)
#endif
-#include <flash.h>
#ifndef CONFIG_MTD_NOR_FLASH
# define OFFSET_ADJUSTMENT 0
#else
+#include <flash.h>
# define OFFSET_ADJUSTMENT (flash_info[id.num].start[0])
#endif
diff --git a/cmd/cros_ec.c b/cmd/cros_ec.c
index ad49905d67..90921cecf6 100644
--- a/cmd/cros_ec.c
+++ b/cmd/cros_ec.c
@@ -10,7 +10,6 @@
#include <command.h>
#include <cros_ec.h>
#include <dm.h>
-#include <flash.h>
#include <log.h>
#include <dm/device-internal.h>
#include <dm/uclass-internal.h>
diff --git a/cmd/extension_board.c b/cmd/extension_board.c
index bbb4812ff8..f94abd612d 100644
--- a/cmd/extension_board.c
+++ b/cmd/extension_board.c
@@ -111,6 +111,7 @@ static int do_extension_apply(struct cmd_tbl *cmdtp, int flag,
return CMD_RET_USAGE;
if (strcmp(argv[1], "all") == 0) {
+ ret = CMD_RET_FAILURE;
list_for_each_entry(extension, &extension_list, list) {
ret = extension_apply(extension);
if (ret != CMD_RET_SUCCESS)
diff --git a/cmd/flash.c b/cmd/flash.c
index db4bb2529c..f4f85ecc7a 100644
--- a/cmd/flash.c
+++ b/cmd/flash.c
@@ -25,7 +25,6 @@ int find_dev_and_part(const char *id, struct mtd_device **dev,
#ifdef CONFIG_MTD_NOR_FLASH
#include <flash.h>
#include <mtd/cfi_flash.h>
-extern flash_info_t flash_info[]; /* info for FLASH chips */
/*
* The user interface starts numbering for Flash banks with 1
diff --git a/cmd/jffs2.c b/cmd/jffs2.c
index 914a7beeed..e00fcc2022 100644
--- a/cmd/jffs2.c
+++ b/cmd/jffs2.c
@@ -73,7 +73,9 @@
#include <common.h>
#include <command.h>
#include <env.h>
+#if defined(CONFIG_CMD_FLASH)
#include <flash.h>
+#endif
#include <image.h>
#include <malloc.h>
#include <jffs2/jffs2.h>
@@ -156,7 +158,6 @@ static int mtd_device_validate(u8 type, u8 num, u32 *size)
if (type == MTD_DEV_TYPE_NOR) {
#if defined(CONFIG_CMD_FLASH)
if (num < CONFIG_SYS_MAX_FLASH_BANKS) {
- extern flash_info_t flash_info[];
*size = flash_info[num].size;
return 0;
@@ -260,8 +261,6 @@ static inline u32 get_part_sector_size_nand(struct mtdids *id)
static inline u32 get_part_sector_size_nor(struct mtdids *id, struct part_info *part)
{
#if defined(CONFIG_CMD_FLASH)
- extern flash_info_t flash_info[];
-
u32 end_phys, start_phys, sector_size = 0, size = 0;
int i;
flash_info_t *flash;
diff --git a/cmd/load.c b/cmd/load.c
index 1224a7f85b..e44ae0d56b 100644
--- a/cmd/load.c
+++ b/cmd/load.c
@@ -14,7 +14,9 @@
#include <efi_loader.h>
#include <env.h>
#include <exports.h>
+#ifdef CONFIG_MTD_NOR_FLASH
#include <flash.h>
+#endif
#include <image.h>
#include <lmb.h>
#include <mapmem.h>
diff --git a/cmd/mem.c b/cmd/mem.c
index b7511382d3..1f4e3fcded 100644
--- a/cmd/mem.c
+++ b/cmd/mem.c
@@ -16,7 +16,9 @@
#include <cli.h>
#include <command.h>
#include <console.h>
+#ifdef CONFIG_MTD_NOR_FLASH
#include <flash.h>
+#endif
#include <hash.h>
#include <log.h>
#include <mapmem.h>
diff --git a/cmd/mvebu/bubt.c b/cmd/mvebu/bubt.c
index ffa05bc201..2136af6416 100644
--- a/cmd/mvebu/bubt.c
+++ b/cmd/mvebu/bubt.c
@@ -8,7 +8,6 @@
#include <common.h>
#include <command.h>
#include <env.h>
-#include <flash.h>
#include <image.h>
#include <net.h>
#include <vsprintf.h>
diff --git a/cmd/sf.c b/cmd/sf.c
index cd50b38081..058635cb2f 100644
--- a/cmd/sf.c
+++ b/cmd/sf.c
@@ -9,7 +9,6 @@
#include <command.h>
#include <div64.h>
#include <dm.h>
-#include <flash.h>
#include <log.h>
#include <malloc.h>
#include <mapmem.h>