1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-09-03 09:42:22 +02:00

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>
This commit is contained in:
Bin Meng
2019-09-09 06:00:01 -07:00
committed by Jagan Teki
parent 4dd520b36b
commit 4b06000395
7 changed files with 8 additions and 8 deletions

View File

@@ -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;
}