diff --git a/drivers/at25xxx/at25xxx.c b/drivers/at25xxx/at25xxx.c index 33509b9cf0..b2b3d59e53 100644 --- a/drivers/at25xxx/at25xxx.c +++ b/drivers/at25xxx/at25xxx.c @@ -113,7 +113,7 @@ static ssize_t _write_page(const at25xxx_t *dev, uint32_t pos, const void *data, int at25xxx_write(const at25xxx_t *dev, uint32_t pos, const void *data, size_t len) { - int res = 0; + int res = len; const uint8_t *d = data; if (pos + len > dev->params.size) { @@ -164,7 +164,7 @@ int at25xxx_read(const at25xxx_t *dev, uint32_t pos, void *data, size_t len) spi_release(dev->params.spi); - return 0; + return len; } uint8_t at25xxx_read_byte(const at25xxx_t *dev, uint32_t pos) diff --git a/drivers/include/at25xxx.h b/drivers/include/at25xxx.h index e4bd598234..33502bd5af 100644 --- a/drivers/include/at25xxx.h +++ b/drivers/include/at25xxx.h @@ -82,7 +82,7 @@ uint8_t at25xxx_read_byte(const at25xxx_t *dev, uint32_t pos); * @param[out] data read buffer * @param[in] len requested length to be read * - * @return 0 on success + * @return Number of bytes read * @return -ERANGE if pos + len > EEPROM size */ int at25xxx_read(const at25xxx_t *dev, uint32_t pos, void *data, size_t len); @@ -104,7 +104,7 @@ void at25xxx_write_byte(const at25xxx_t *dev, uint32_t pos, uint8_t data); * @param[in] data write buffer * @param[in] len requested length to be written * - * @return 0 on success + * @return Number of bytes written * @return -ERANGE if pos + len > EEPROM size */ int at25xxx_write(const at25xxx_t *dev, uint32_t pos, const void *data, size_t len);