From ea734404f3daf1f6b5103171d848c9d4641fd96b Mon Sep 17 00:00:00 2001 From: Wolfram Sang Date: Tue, 9 Aug 2016 13:36:17 +0200 Subject: i2c: don't print error when adding adapter fails The core will do this for us now. Signed-off-by: Wolfram Sang Reviewed-by: Grygorii Strashko Acked-by: Peter Korsgaard Acked-by: Heiko Stuebner Acked-by: Neil Horman Acked-by: Thierry Reding Acked-by: Ray Jui Acked-by: Vladimir Zapolskiy Acked-by: Ludovic Desroches Acked-by: Krzysztof Kozlowski Acked-by: Laxman Dewangan Signed-off-by: Wolfram Sang --- drivers/i2c/busses/i2c-rk3x.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'drivers/i2c/busses/i2c-rk3x.c') diff --git a/drivers/i2c/busses/i2c-rk3x.c b/drivers/i2c/busses/i2c-rk3x.c index 2bc8b01153d6..3b87afe82f63 100644 --- a/drivers/i2c/busses/i2c-rk3x.c +++ b/drivers/i2c/busses/i2c-rk3x.c @@ -1303,10 +1303,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); -- cgit v1.2.3 From a8a7d09e7304b107957e8c45882cdbb5b51bd111 Mon Sep 17 00:00:00 2001 From: David Wu Date: Thu, 22 Sep 2016 19:29:23 +0800 Subject: i2c: rk3x: Fix sparse warning This patch fixes the following sparse warning: drivers/i2c/busses/i2c-rk3x.c:888:17: warning: cast truncates bits from constant value (ffffffffff00 becomes ffffff00) Reported-by: Wolfram Sang Signed-off-by: David Wu Signed-off-by: Wolfram Sang --- drivers/i2c/busses/i2c-rk3x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/i2c/busses/i2c-rk3x.c') diff --git a/drivers/i2c/busses/i2c-rk3x.c b/drivers/i2c/busses/i2c-rk3x.c index 3b87afe82f63..dbbdbece778a 100644 --- a/drivers/i2c/busses/i2c-rk3x.c +++ b/drivers/i2c/busses/i2c-rk3x.c @@ -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) -- cgit v1.2.3 From 72cf8c565cf4e25312fb9fa65d306ae736104ade Mon Sep 17 00:00:00 2001 From: David Wu Date: Thu, 22 Sep 2016 19:29:24 +0800 Subject: i2c: rk3x: Fix variable 'min_total_ns' unused warning This patch fixs the following warning: drivers/i2c/busses/i2c-rk3x.c: In function 'rk3x_i2c_v1_calc_timings': drivers/i2c/busses/i2c-rk3x.c:745:41: warning: variable 'min_total_ns' set but not used [-Wunused-but-set-variable] Reported-by: Wolfram Sang Signed-off-by: David Wu Signed-off-by: Wolfram Sang --- drivers/i2c/busses/i2c-rk3x.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'drivers/i2c/busses/i2c-rk3x.c') diff --git a/drivers/i2c/busses/i2c-rk3x.c b/drivers/i2c/busses/i2c-rk3x.c index dbbdbece778a..c528e191f069 100644 --- a/drivers/i2c/busses/i2c-rk3x.c +++ b/drivers/i2c/busses/i2c-rk3x.c @@ -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. -- cgit v1.2.3