projects
/
oweals
/
u-boot.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
74xx_7xx: Cleanup for partial linking and --gc-sections
[oweals/u-boot.git]
/
drivers
/
mtd
/
spi
/
eeprom_m95xxx.c
diff --git
a/drivers/mtd/spi/eeprom_m95xxx.c
b/drivers/mtd/spi/eeprom_m95xxx.c
index 59f80e39ff22e3d97415c7f915a7022e8fcb689e..632db4e9e0a60c57ab94a4c54a2b2b9123cb42d0 100644
(file)
--- a/
drivers/mtd/spi/eeprom_m95xxx.c
+++ b/
drivers/mtd/spi/eeprom_m95xxx.c
@@
-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);
slave = spi_setup_slave(CONFIG_DEFAULT_SPI_BUS, 1, 1000000,
CONFIG_DEFAULT_SPI_MODE);
+ if(!slave)
+ return 0;
+
spi_claim_bus(slave);
/* command */
spi_claim_bus(slave);
/* command */
@@
-71,11
+74,13
@@
ssize_t spi_read (uchar *addr, int alen, uchar *buffer, int len)
ssize_t spi_write (uchar *addr, int alen, uchar *buffer, int len)
{
struct spi_slave *slave;
ssize_t spi_write (uchar *addr, int alen, uchar *buffer, int len)
{
struct spi_slave *slave;
- int i;
char buf[3];
slave = spi_setup_slave(CONFIG_DEFAULT_SPI_BUS, 1, 1000000,
CONFIG_DEFAULT_SPI_MODE);
char buf[3];
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;
spi_claim_bus(slave);
buf[0] = SPI_EEPROM_WREN;