aboutsummaryrefslogtreecommitdiff
path: root/include/spi.h
diff options
context:
space:
mode:
authorBin Meng2019-09-09 06:00:01 -0700
committerJagan Teki2019-10-25 00:48:31 +0530
commit4b060003957db07fa0e35beafe6559f9cc91954c (patch)
treeba4a762a7dbe6ed0c16a2a93e6b8a46c2f74876e /include/spi.h
parent4dd520b36bce9b35f7a12f3ffd9a95269d425170 (diff)
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 'include/spi.h')
-rw-r--r--include/spi.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/spi.h b/include/spi.h
index 5eec0c4775e..3f79168df30 100644
--- a/include/spi.h
+++ b/include/spi.h
@@ -458,7 +458,7 @@ struct dm_spi_ops {
* @cs: The chip select (0..n-1)
* @info: Returns information about the chip select, if valid.
* On entry info->dev is NULL
- * @return 0 if OK (and @info is set up), -ENODEV if the chip select
+ * @return 0 if OK (and @info is set up), -EINVAL if the chip select
* is invalid, other -ve value on error
*/
int (*cs_info)(struct udevice *bus, uint cs, struct spi_cs_info *info);