From 1a33afb66c98160236dc5809cb24ad8658d083a9 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 26 Nov 2014 15:37:01 -0600 Subject: [PATCH] Fix to get a clean build with EEPROM support disabled --- drivers/eeprom/Make.defs | 6 +++++- drivers/eeprom/spi_xx25xx.c | 6 ++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/eeprom/Make.defs b/drivers/eeprom/Make.defs index ce301be879..d9588c7c68 100644 --- a/drivers/eeprom/Make.defs +++ b/drivers/eeprom/Make.defs @@ -33,11 +33,15 @@ # ############################################################################ -ifneq ($(CONFIG_SPI_EE_25XX),0) +# Include SPI EEPROM support + +ifeq ($(CONFIG_SPI_EEPROM),y) # Include the Microchip/Atmel xx25xx driver +ifeq ($(CONFIG_SPI_EE_25XX),y) CSRCS += spi_xx25xx.c +endif # Include build support diff --git a/drivers/eeprom/spi_xx25xx.c b/drivers/eeprom/spi_xx25xx.c index 41623ea8f9..3602eaf44f 100644 --- a/drivers/eeprom/spi_xx25xx.c +++ b/drivers/eeprom/spi_xx25xx.c @@ -612,11 +612,9 @@ static ssize_t ee25xx_read(FAR struct file *filep, FAR char *buffer, SPI_SELECT(eedev->spi, SPIDEV_EEPROM, false); ee25xx_unlock(eedev->spi); - if (ret > 0) - { - filep->f_pos += len; - } + /* Update the file position */ + filep->f_pos += len; ee25xx_semgive(eedev); return len; }