Message ID | 20200901211102.11072-6-digetx@gmail.com |
---|---|
State | Superseded |
Headers | show |
Series | Improvements for Tegra I2C driver | expand |
diff --git a/drivers/i2c/busses/i2c-tegra.c b/drivers/i2c/busses/i2c-tegra.c index 2da45ff32621..aa815e48f77e 100644 --- a/drivers/i2c/busses/i2c-tegra.c +++ b/drivers/i2c/busses/i2c-tegra.c @@ -790,9 +790,9 @@ static int tegra_i2c_init(struct tegra_i2c_dev *i2c_dev, bool clk_reinit) u32 tsu_thd; u8 tlow, thigh; - reset_control_assert(i2c_dev->rst); - udelay(2); - reset_control_deassert(i2c_dev->rst); + err = reset_control_reset(i2c_dev->rst); + if (WARN_ON_ONCE(err)) + return err; if (i2c_dev->is_dvc) tegra_dvc_init(i2c_dev);
Use a single reset_control_reset() instead of assert/deasset couple in order to make code cleaner a tad. Note that the reset_control_reset() uses 1 microsecond delay instead of 2 that was used previously, but this shouldn't matter. In addition don't ignore potential error of the reset. Signed-off-by: Dmitry Osipenko <digetx@gmail.com> --- drivers/i2c/busses/i2c-tegra.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)