Merge branch 'i2c/for-4.9' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux
[linux-2.6-block.git] / drivers / i2c / busses / i2c-rk3x.c
index 5c5b7cada8beef28d2d9e5c94bfa5d0c355d8af0..50702c7bb244beec821e4d04e0352c07ee516a21 100644 (file)
@@ -58,7 +58,7 @@ enum {
 #define REG_CON_LASTACK   BIT(5) /* 1: send NACK after last received byte */
 #define REG_CON_ACTACK    BIT(6) /* 1: stop if NACK is received */
 
-#define REG_CON_TUNING_MASK GENMASK(15, 8)
+#define REG_CON_TUNING_MASK GENMASK_ULL(15, 8)
 
 #define REG_CON_SDA_CFG(cfg) ((cfg) << 8)
 #define REG_CON_STA_CFG(cfg) ((cfg) << 12)
@@ -742,7 +742,7 @@ static int rk3x_i2c_v1_calc_timings(unsigned long clk_rate,
                                    struct i2c_timings *t,
                                    struct rk3x_i2c_calced_timings *t_calc)
 {
-       unsigned long min_low_ns, min_high_ns, min_total_ns;
+       unsigned long min_low_ns, min_high_ns;
        unsigned long min_setup_start_ns, min_setup_data_ns;
        unsigned long min_setup_stop_ns, max_hold_data_ns;
 
@@ -793,7 +793,6 @@ static int rk3x_i2c_v1_calc_timings(unsigned long clk_rate,
 
        /* These are the min dividers needed for min hold times. */
        min_div_for_hold = (min_low_div + min_high_div);
-       min_total_ns = min_low_ns + min_high_ns;
 
        /*
         * This is the maximum divider so we don't go over the maximum.
@@ -1312,10 +1311,8 @@ static int rk3x_i2c_probe(struct platform_device *pdev)
        rk3x_i2c_adapt_div(i2c, clk_rate);
 
        ret = i2c_add_adapter(&i2c->adap);
-       if (ret < 0) {
-               dev_err(&pdev->dev, "Could not register adapter\n");
+       if (ret < 0)
                goto err_clk_notifier;
-       }
 
        dev_info(&pdev->dev, "Initialized RK3xxx I2C bus at %p\n", i2c->regs);