aboutsummaryrefslogtreecommitdiff
path: root/doc/driver-model
diff options
context:
space:
mode:
authorBin Meng <bmeng.cn@gmail.com>2019-09-09 06:00:01 -0700
committerJagan Teki <jagan@amarulasolutions.com>2019-10-25 00:48:31 +0530
commit4b060003957db07fa0e35beafe6559f9cc91954c (patch)
treeba4a762a7dbe6ed0c16a2a93e6b8a46c2f74876e /doc/driver-model
parent4dd520b36bce9b35f7a12f3ffd9a95269d425170 (diff)
downloadu-boot-4b060003957db07fa0e35beafe6559f9cc91954c.zip
u-boot-4b060003957db07fa0e35beafe6559f9cc91954c.tar.gz
u-boot-4b060003957db07fa0e35beafe6559f9cc91954c.tar.bz2
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 'doc/driver-model')
-rw-r--r--doc/driver-model/spi-howto.rst4
1 files changed, 2 insertions, 2 deletions
diff --git a/doc/driver-model/spi-howto.rst b/doc/driver-model/spi-howto.rst
index 44eab39..9631a50 100644
--- a/doc/driver-model/spi-howto.rst
+++ b/doc/driver-model/spi-howto.rst
@@ -116,7 +116,7 @@ Put this code at the bottom of your existing driver file:
static int exynos_cs_info(struct udevice *bus, uint cs,
struct spi_cs_info *info)
{
- return -ENODEV;
+ return -EINVAL;
}
static const struct dm_spi_ops exynos_spi_ops = {
@@ -633,7 +633,7 @@ is not obvious from outside the driver. In this case you can provide a
method for cs_info() to deal with this. If you don't provide it, then the
device tree will be used to determine what chip selects are valid.
-Return -ENODEV if the supplied chip select is invalid, or 0 if it is valid.
+Return -EINVAL if the supplied chip select is invalid, or 0 if it is valid.
If you don't provide the cs_info() method, 0 is assumed for all chip selects
that do not appear in the device tree.