summaryrefslogtreecommitdiff
path: root/drivers/spi/sandbox_spi.c
diff options
context:
space:
mode:
authorBin Meng <bmeng.cn@gmail.com>2019-09-09 16:00:01 +0300
committerJagan Teki <jagan@amarulasolutions.com>2019-10-24 22:18:31 +0300
commit4b060003957db07fa0e35beafe6559f9cc91954c (patch)
treeba4a762a7dbe6ed0c16a2a93e6b8a46c2f74876e /drivers/spi/sandbox_spi.c
parent4dd520b36bce9b35f7a12f3ffd9a95269d425170 (diff)
downloadu-boot-4b060003957db07fa0e35beafe6559f9cc91954c.tar.xz
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 <bmeng.cn@gmail.com> Tested-by: Jagan Teki <jagan@amarulasolutions.com> # SoPine Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
Diffstat (limited to 'drivers/spi/sandbox_spi.c')
-rw-r--r--drivers/spi/sandbox_spi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/spi/sandbox_spi.c b/drivers/spi/sandbox_spi.c
index 906401ec8a..16473ec7a0 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;
}