From 834e5841695aea418dfc9f941a3645cad6f8ab36 Mon Sep 17 00:00:00 2001 From: Alexander Vasiljev Date: Fri, 25 Sep 2020 12:24:05 +0300 Subject: [PATCH] spi_xx25xx: in write operation return the number of bytes written not the result of ee25xx_semtake --- drivers/eeprom/spi_xx25xx.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/eeprom/spi_xx25xx.c b/drivers/eeprom/spi_xx25xx.c index f89c7b3fbf..2595bdc7a9 100644 --- a/drivers/eeprom/spi_xx25xx.c +++ b/drivers/eeprom/spi_xx25xx.c @@ -730,18 +730,18 @@ static ssize_t ee25xx_write(FAR struct file *filep, FAR const char *buffer, len = eedev->size - filep->f_pos; } - /* From this point no failure cannot be detected anymore. - * The user should verify the write by rereading memory. - */ - - ret = len; /* save number of bytes written */ - ret = ee25xx_semtake(eedev); if (ret < 0) { return ret; } + /* From this point no failure cannot be detected anymore. + * The user should verify the write by rereading memory. + */ + + ret = len; /* save number of bytes written */ + /* Writes can't happen in a row like the read does. * The EEPROM is made of pages, and write sequences * cannot cross page boundaries. So every time the last