Skip to content

Commit 21e9efd

Browse files
shariffsinboxWolfram Sang
authored andcommitted
i2c: tegra: disable clock before returning error
Disable clock before returning error in tegra_i2c_init() as its leaves i2c clock ON in case of error and never turns off again as it will have unbalanced clock enable/disable Signed-off-by: Shardar Shariff Md <smohammed@nvidia.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
1 parent 3f30e40 commit 21e9efd

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

‎drivers/i2c/busses/i2c-tegra.c‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -483,19 +483,20 @@ static int tegra_i2c_init(struct tegra_i2c_dev *i2c_dev)
483483
if (time_after(jiffies, timeout)) {
484484
dev_warn(i2c_dev->dev,
485485
"timeout waiting for config load\n");
486-
return -ETIMEDOUT;
486+
err = -ETIMEDOUT;
487+
goto err;
487488
}
488489
msleep(1);
489490
}
490491
}
491492

492-
tegra_i2c_clock_disable(i2c_dev);
493-
494493
if (i2c_dev->irq_disabled) {
495494
i2c_dev->irq_disabled = 0;
496495
enable_irq(i2c_dev->irq);
497496
}
498497

498+
err:
499+
tegra_i2c_clock_disable(i2c_dev);
499500
return err;
500501
}
501502

0 commit comments

Comments
 (0)