Skip to content
Snippets Groups Projects
Commit f852a0c3 authored by Albin Tonnerre's avatar Albin Tonnerre Committed by Wolfgang Denk
Browse files

drivers/mtd/spi/eeprom_m95xxx.c: add missing error checking

parent 74b86d2d
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment