summaryrefslogtreecommitdiffstats
path: root/drivers/i2c
diff options
context:
space:
mode:
authorNicolas Le Bayon <nicolas.le.bayon@st.com>2019-03-06 15:12:32 +0000
committerWolfram Sang <wsa@the-dreams.de>2019-03-20 17:59:05 +0100
commit0d7350316a2a773254cd261daa8d3f2c4dd38610 (patch)
tree9d9416a508c9b04434bf2bffbca6687e79d3ac58 /drivers/i2c
parentc62ebb3d5f0d0e9dafe990c9ce680ca9b46fd4c1 (diff)
downloadlinux-0d7350316a2a773254cd261daa8d3f2c4dd38610.tar.bz2
i2c: 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> Signed-off-by: Bich Hemon <bich.hemon@st.com> Reviewed-by: Pierre-Yves MORDRET <pierre-yves.mordret@st.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Diffstat (limited to 'drivers/i2c')
-rw-r--r--drivers/i2c/busses/i2c-stm32f7.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/i2c/busses/i2c-stm32f7.c b/drivers/i2c/busses/i2c-stm32f7.c
index 4284fc991cfd..48337bef5b87 100644
--- a/drivers/i2c/busses/i2c-stm32f7.c
+++ b/drivers/i2c/busses/i2c-stm32f7.c
@@ -476,8 +476,12 @@ static int stm32f7_i2c_compute_timing(struct stm32f7_i2c_dev *i2c_dev,
list_add_tail(&v->node,
&solutions);
+ break;
}
}
+
+ if (p_prev == p)
+ break;
}
}