diff mbox series

[U-Boot] sata: fix sata_Probe return value check

Message ID 20180727234526.307-1-troy.kisky@boundarydevices.com
State Accepted
Commit 7e83f1d5e819c76d50fc4daee9d4b5348bf3dc0f
Delegated to: Tom Rini
Headers show
Series [U-Boot] sata: fix sata_Probe return value check | expand

Commit Message

Troy Kisky July 27, 2018, 11:45 p.m. UTC
sata_probe returns 1 for failure, so don't checkout for < 0

fixes: f19f1ecb6025 dm: sata: Support driver model with the 'sata' command

Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>

Comments

Simon Glass July 31, 2018, 11:52 a.m. UTC | #1
On 27 July 2018 at 17:45, Troy Kisky <troy.kisky@boundarydevices.com> wrote:
>
> sata_probe returns 1 for failure, so don't checkout for < 0
>
> fixes: f19f1ecb6025 dm: sata: Support driver model with the 'sata' command
>
> Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
>

Thanks!

Reviewed-by: Simon Glass <sjg@chromium.org>
Tom Rini Aug. 11, 2018, 1:45 a.m. UTC | #2
On Fri, Jul 27, 2018 at 04:45:26PM -0700, Troy Kisky wrote:

> sata_probe returns 1 for failure, so don't checkout for < 0
> 
> fixes: f19f1ecb6025 dm: sata: Support driver model with the 'sata' command
> 
> Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
> Reviewed-by: Simon Glass <sjg@chromium.org>
> 
> diff --git a/cmd/sata.c b/cmd/sata.c
> index cc12afb07e..4f0c6e0137 100644

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

Patch

diff --git a/cmd/sata.c b/cmd/sata.c
index cc12afb07e..4f0c6e0137 100644
--- a/cmd/sata.c
+++ b/cmd/sata.c
@@ -107,8 +107,8 @@  static int do_sata(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	/* If the user has not yet run `sata init`, do it now */
 	if (sata_curr_device == -1) {
 		rc = sata_probe(0);
-		if (rc < 0)
-			return CMD_RET_FAILURE;
+		if (rc)
+			return rc;
 		sata_curr_device = 0;
 	}