diff options
author | Nicolas Le Bayon | 2019-04-18 17:32:43 +0200 |
---|---|---|
committer | Patrice Chotard | 2019-05-23 11:36:47 +0200 |
commit | 5237f37e5c35052533588fe0a53febad2f047d70 (patch) | |
tree | 3a1dcc7efd69321a818bfedec9c351fa2924e084 /drivers/i2c | |
parent | e87da7521f922e3d0f6aaa6b162e872f8f39c649 (diff) |
i2c: stm32f7: improve loopback in timing algorithm
This avoids useless loops inside the I2C timing algorithm.
Actually, we support only one possible solution per prescaler value.
So after finding a solution with a prescaler, the algorithm can
switch directly to the next prescaler value.
Signed-off-by: Nicolas Le Bayon <nicolas.le.bayon@st.com>
Reviewed-by: Patrick DELAUNAY <patrick.delaunay@st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Diffstat (limited to 'drivers/i2c')
-rw-r--r-- | drivers/i2c/stm32f7_i2c.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/i2c/stm32f7_i2c.c b/drivers/i2c/stm32f7_i2c.c index e7e0268ebeb..50c4fd0de23 100644 --- a/drivers/i2c/stm32f7_i2c.c +++ b/drivers/i2c/stm32f7_i2c.c @@ -540,8 +540,12 @@ static int stm32_i2c_compute_solutions(struct stm32_i2c_setup *setup, p_prev = p; list_add_tail(&v->node, solutions); + break; } } + + if (p_prev == p) + break; } } |