diff mbox series

[U-Boot,v4,4/4] cmd: ide: Make the first device the default one

Message ID 1505045573-11552-4-git-send-email-bmeng.cn@gmail.com
State Accepted
Delegated to: Tom Rini
Headers show
Series [U-Boot,v4,1/4] blk: Use macros for block device vendor/product/rev string size | expand

Commit Message

Bin Meng Sept. 10, 2017, 12:12 p.m. UTC
At present the IDE device number is initialized to -1, which means
we cannot type "ide read" command before setting the device number
via "ide device #".

For convenience, let's set the first device as the default one.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

---

Changes in v4: None
Changes in v3: None
Changes in v2: None

 cmd/ide.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Tom Rini Sept. 10, 2017, 10:02 p.m. UTC | #1
On Sun, Sep 10, 2017 at 05:12:53AM -0700, Bin Meng wrote:

> At present the IDE device number is initialized to -1, which means
> we cannot type "ide read" command before setting the device number
> via "ide device #".
> 
> For convenience, let's set the first device as the default one.
> 
> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
> Reviewed-by: Simon Glass <sjg@chromium.org>
> 

Applied to u-boot/master, thanks!
diff mbox series

Patch

diff --git a/cmd/ide.c b/cmd/ide.c
index e3c3242..bdb5980 100644
--- a/cmd/ide.c
+++ b/cmd/ide.c
@@ -30,7 +30,7 @@ 
 #endif
 
 /* Current I/O Device	*/
-static int curr_device = -1;
+static int curr_device;
 
 int do_ide(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
 {