Commit 71dc297c authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Wolfram Sang

i2c: designware: assert reset when error happen at ->probe()

The commit c62ebb3d ("i2c: designware: Add support for an interface clock")
introduced an optional clock while missed correct error handling.
assert reset line back if error happen at ->probe().

Fixes: c62ebb3d ("i2c: designware: Add support for an interface clock")
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: default avatarJarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
parent f9bf7a89
......@@ -346,8 +346,10 @@ static int dw_i2c_plat_probe(struct platform_device *pdev)
/* Optional interface clock */
dev->pclk = devm_clk_get_optional(&pdev->dev, "pclk");
if (IS_ERR(dev->pclk))
return PTR_ERR(dev->pclk);
if (IS_ERR(dev->pclk)) {
ret = PTR_ERR(dev->pclk);
goto exit_reset;
}
dev->clk = devm_clk_get(&pdev->dev, NULL);
if (!i2c_dw_prepare_clk(dev, true)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment