Since we have generic definitions for bus frequencies, let's use them. Cc: Vladimir Zapolskiy <vz@xxxxxxxxx> Signed-off-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx> --- drivers/i2c/busses/i2c-lpc2k.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/i2c/busses/i2c-lpc2k.c b/drivers/i2c/busses/i2c-lpc2k.c index deea18b14add..159ebec5861c 100644 --- a/drivers/i2c/busses/i2c-lpc2k.c +++ b/drivers/i2c/busses/i2c-lpc2k.c @@ -396,7 +396,7 @@ static int i2c_lpc2k_probe(struct platform_device *pdev) ret = of_property_read_u32(pdev->dev.of_node, "clock-frequency", &bus_clk_rate); if (ret) - bus_clk_rate = 100000; /* 100 kHz default clock rate */ + bus_clk_rate = I2C_STANDARD_MODE_FREQ; /* 100 kHz default clock rate */ clkrate = clk_get_rate(i2c->clk); if (clkrate == 0) { @@ -407,9 +407,9 @@ static int i2c_lpc2k_probe(struct platform_device *pdev) /* Setup I2C dividers to generate clock with proper duty cycle */ clkrate = clkrate / bus_clk_rate; - if (bus_clk_rate <= 100000) + if (bus_clk_rate <= I2C_STANDARD_MODE_FREQ) scl_high = (clkrate * I2C_STD_MODE_DUTY) / 100; - else if (bus_clk_rate <= 400000) + else if (bus_clk_rate <= I2C_FAST_MODE_FREQ) scl_high = (clkrate * I2C_FAST_MODE_DUTY) / 100; else scl_high = (clkrate * I2C_FAST_MODE_PLUS_DUTY) / 100; -- 2.25.0