mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-18 13:11:31 +00:00
drivers/mtd/spi/eeprom_m95xxx.c: add missing error checking
Signed-off-by: Albin Tonnerre <albin.tonnerre@free-electrons.com>
This commit is contained in:
parent
74b86d2d51
commit
f852a0c3bf
1 changed files with 6 additions and 0 deletions
|
@ -44,6 +44,9 @@ ssize_t spi_read (uchar *addr, int alen, uchar *buffer, int len)
|
|||
|
||||
slave = spi_setup_slave(CONFIG_DEFAULT_SPI_BUS, 1, 1000000,
|
||||
CONFIG_DEFAULT_SPI_MODE);
|
||||
if(!slave)
|
||||
return 0;
|
||||
|
||||
spi_claim_bus(slave);
|
||||
|
||||
/* command */
|
||||
|
@ -75,6 +78,9 @@ ssize_t spi_write (uchar *addr, int alen, uchar *buffer, int len)
|
|||
|
||||
slave = spi_setup_slave(CONFIG_DEFAULT_SPI_BUS, 1, 1000000,
|
||||
CONFIG_DEFAULT_SPI_MODE);
|
||||
if (!slave)
|
||||
return 0;
|
||||
|
||||
spi_claim_bus(slave);
|
||||
|
||||
buf[0] = SPI_EEPROM_WREN;
|
||||
|
|
Loading…
Add table
Reference in a new issue