From 4b060003957db07fa0e35beafe6559f9cc91954c Mon Sep 17 00:00:00 2001 From: Bin Meng Date: Mon, 9 Sep 2019 06:00:01 -0700 Subject: dm: spi: Change cs_info op to return -EINVAL for invalid cs num We need distinguish the following two situations in various SPI APIs: - given chip select num is invalid - given chip select num is valid, but no device is attached Currently -ENODEV is returned for both cases. For the first case, it's more reasonable to return -EINVAL instead of -ENODEV for invalid chip select numbers. Signed-off-by: Bin Meng Tested-by: Jagan Teki # SoPine Reviewed-by: Jagan Teki --- drivers/spi/sandbox_spi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/spi/sandbox_spi.c') diff --git a/drivers/spi/sandbox_spi.c b/drivers/spi/sandbox_spi.c index 906401ec8ab..16473ec7a0b 100644 --- a/drivers/spi/sandbox_spi.c +++ b/drivers/spi/sandbox_spi.c @@ -117,7 +117,7 @@ static int sandbox_cs_info(struct udevice *bus, uint cs, { /* Always allow activity on CS 0 */ if (cs >= 1) - return -ENODEV; + return -EINVAL; return 0; } -- cgit v1.2.3