From 5bba339a7c21118bb53306da659d3487e0c2c10f Mon Sep 17 00:00:00 2001 From: Marian Buschsieweke Date: Thu, 22 Aug 2019 11:41:45 +0200 Subject: [PATCH] drivers/periph/i2c: Fixed i2c_release() signature i2c_release() should not have a return value, as: - There is no reasonable error handling possible by the caller, so there is no value in indicating success/failure via the return value to the caller - There is no legitimate reason to fail *unless* an invalid I2C bus was released or an I2C bus that was not previously acquired was released --> This would indicate a bug in the code and should be tackled by an assert() --- drivers/include/periph/i2c.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/include/periph/i2c.h b/drivers/include/periph/i2c.h index 3cc3b58573..69824f8905 100644 --- a/drivers/include/periph/i2c.h +++ b/drivers/include/periph/i2c.h @@ -231,10 +231,8 @@ int i2c_acquire(i2c_t dev); * @brief Release the given I2C device to be used by others * * @param[in] dev I2C device to release - * - * @return 0 on success, -1 on error */ -int i2c_release(i2c_t dev); +void i2c_release(i2c_t dev); /** * @brief Convenience function for reading one byte from a given register