mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-06-13 15:03:58 +03:00
dm: spi: Check cs number before accessing slaves
Add chip select number check in spi_find_chip_select(). Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Jagan Teki <jagan@amarulasolutions.com> # SoPine
This commit is contained in:
@@ -561,7 +561,8 @@ int spi_chip_select(struct udevice *slave);
|
||||
* @bus: SPI bus to search
|
||||
* @cs: Chip select to look for
|
||||
* @devp: Returns the slave device if found
|
||||
* @return 0 if found, -ENODEV on error
|
||||
* @return 0 if found, -EINVAL if cs is invalid, -ENODEV if no device attached,
|
||||
* other -ve value on error
|
||||
*/
|
||||
int spi_find_chip_select(struct udevice *bus, int cs, struct udevice **devp);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user