summaryrefslogtreecommitdiff
path: root/drivers/i2c/busses/i2c-kempld.c
diff options
context:
space:
mode:
authorMichael Brunner <mibru@gmx.de>2013-07-26 16:04:55 +0400
committerWolfram Sang <wsa@the-dreams.de>2013-08-05 12:31:18 +0400
commit4c715661d9a2ceb12434784f10d252f353251906 (patch)
treea7b703f4037f156f611bd565dcda5de94da10e74 /drivers/i2c/busses/i2c-kempld.c
parentd6e102f498cbcc8dd2e36721a01213f036397112 (diff)
downloadlinux-4c715661d9a2ceb12434784f10d252f353251906.tar.xz
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: Michael Brunner <michael.brunner@kontron.com> Tested-by: Guenter Roeck <linux@roeck-us.net> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Diffstat (limited to 'drivers/i2c/busses/i2c-kempld.c')
-rw-r--r--drivers/i2c/busses/i2c-kempld.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/i2c/busses/i2c-kempld.c b/drivers/i2c/busses/i2c-kempld.c
index ccec916bc3eb..af8f65fb1c05 100644
--- a/drivers/i2c/busses/i2c-kempld.c
+++ b/drivers/i2c/busses/i2c-kempld.c
@@ -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;