i2c: stm32: get rid of stm32f7_i2c_release_bus return value
authorAlain Volmat <alain.volmat@foss.st.com>
Wed, 1 Dec 2021 11:47:50 +0000 (12:47 +0100)
committerWolfram Sang <wsa@kernel.org>
Wed, 1 Dec 2021 21:14:01 +0000 (22:14 +0100)
Function stm32f7_i2c_release_bus is always returning 0, hence it
should be a void function.  Update the function and remove the
return value error checking code in caller functions.

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
drivers/i2c/busses/i2c-stm32f7.c

index b9b19a2a2ffa0b83957cdec0314b636db968b168..9b713c50abb87e65ce61c7f439f3beaad3901daf 100644 (file)
@@ -828,7 +828,7 @@ static void stm32f7_i2c_smbus_reload(struct stm32f7_i2c_dev *i2c_dev)
        writel_relaxed(cr2, i2c_dev->base + STM32F7_I2C_CR2);
 }
 
-static int stm32f7_i2c_release_bus(struct i2c_adapter *i2c_adap)
+static void stm32f7_i2c_release_bus(struct i2c_adapter *i2c_adap)
 {
        struct stm32f7_i2c_dev *i2c_dev = i2c_get_adapdata(i2c_adap);
 
@@ -838,8 +838,6 @@ static int stm32f7_i2c_release_bus(struct i2c_adapter *i2c_adap)
                             STM32F7_I2C_CR1_PE);
 
        stm32f7_i2c_hw_config(i2c_dev);
-
-       return 0;
 }
 
 static int stm32f7_i2c_wait_free_bus(struct stm32f7_i2c_dev *i2c_dev)
@@ -856,11 +854,7 @@ static int stm32f7_i2c_wait_free_bus(struct stm32f7_i2c_dev *i2c_dev)
 
        dev_info(i2c_dev->dev, "bus busy\n");
 
-       ret = stm32f7_i2c_release_bus(&i2c_dev->adap);
-       if (ret) {
-               dev_err(i2c_dev->dev, "Failed to recover the bus (%d)\n", ret);
-               return ret;
-       }
+       stm32f7_i2c_release_bus(&i2c_dev->adap);
 
        return -EBUSY;
 }