提交 4c715661 编写于 作者: M Michael Brunner 提交者: Wolfram Sang

i2c: Fix Kontron PLD prescaler calculation

Add some necessary braces that have been removed during driver cleanup.
This fixes the I2C prescaler calculation.
Signed-off-by: NMichael Brunner <michael.brunner@kontron.com>
Tested-by: NGuenter Roeck <linux@roeck-us.net>
Reviewed-by: NGuenter Roeck <linux@roeck-us.net>
Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
上级 d6e102f4
......@@ -246,9 +246,9 @@ static void kempld_i2c_device_init(struct kempld_i2c_data *i2c)
bus_frequency = KEMPLD_I2C_FREQ_MAX;
if (pld->info.spec_major == 1)
prescale = pld->pld_clock / bus_frequency * 5 - 1000;
prescale = pld->pld_clock / (bus_frequency * 5) - 1000;
else
prescale = pld->pld_clock / bus_frequency * 4 - 3000;
prescale = pld->pld_clock / (bus_frequency * 4) - 3000;
if (prescale < 0)
prescale = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册