rtc: m41t80: m41t80_sqw_set_rate should return 0 on success
authorTroy Kisky <troy.kisky@boundarydevices.com>
Fri, 3 Nov 2017 01:58:12 +0000 (18:58 -0700)
committerAlexandre Belloni <alexandre.belloni@free-electrons.com>
Wed, 8 Nov 2017 06:52:23 +0000 (07:52 +0100)
Previously it was returning -EINVAL upon success.

Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
drivers/rtc/rtc-m41t80.c

index f4c070ea83849a9e67f700519f0f83b8b7541227..8f5843169dc247663b03b2cdde828a505b5936d5 100644 (file)
@@ -510,10 +510,7 @@ static int m41t80_sqw_set_rate(struct clk_hw *hw, unsigned long rate,
        reg = (reg & 0x0f) | (val << 4);
 
        ret = i2c_smbus_write_byte_data(client, reg_sqw, reg);
-       if (ret < 0)
-               return ret;
-
-       return -EINVAL;
+       return ret;
 }
 
 static int m41t80_sqw_control(struct clk_hw *hw, bool enable)