mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
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 <[email protected]> Tested-by: Guenter Roeck <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
This commit is contained in:
parent
d6e102f498
commit
4c715661d9
1 changed files with 2 additions and 2 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue