Revert "i2c: xiic: Use devm_clk_get_enabled()"
This reverts commit ece3f22d54
.
This commit is contained in:
parent
f88bd7f937
commit
4a9666c457
1 changed files with 13 additions and 7 deletions
|
@ -837,11 +837,16 @@ static int xiic_i2c_probe(struct platform_device *pdev)
|
|||
|
||||
mutex_init(&i2c->lock);
|
||||
|
||||
i2c->clk = devm_clk_get_enabled(&pdev->dev, NULL);
|
||||
i2c->clk = devm_clk_get(&pdev->dev, NULL);
|
||||
if (IS_ERR(i2c->clk))
|
||||
return dev_err_probe(&pdev->dev, PTR_ERR(i2c->clk),
|
||||
"failed to enable input clock.\n");
|
||||
"input clock not found.\n");
|
||||
|
||||
ret = clk_prepare_enable(i2c->clk);
|
||||
if (ret) {
|
||||
dev_err(&pdev->dev, "Unable to enable clock.\n");
|
||||
return ret;
|
||||
}
|
||||
i2c->dev = &pdev->dev;
|
||||
pm_runtime_set_autosuspend_delay(i2c->dev, XIIC_PM_TIMEOUT);
|
||||
pm_runtime_use_autosuspend(i2c->dev);
|
||||
|
@ -853,7 +858,7 @@ static int xiic_i2c_probe(struct platform_device *pdev)
|
|||
|
||||
if (ret < 0) {
|
||||
dev_err(&pdev->dev, "Cannot claim IRQ\n");
|
||||
goto err_pm_disable;
|
||||
goto err_clk_dis;
|
||||
}
|
||||
|
||||
i2c->singlemaster =
|
||||
|
@ -874,14 +879,14 @@ static int xiic_i2c_probe(struct platform_device *pdev)
|
|||
ret = xiic_reinit(i2c);
|
||||
if (ret < 0) {
|
||||
dev_err(&pdev->dev, "Cannot xiic_reinit\n");
|
||||
goto err_pm_disable;
|
||||
goto err_clk_dis;
|
||||
}
|
||||
|
||||
/* add i2c adapter to i2c tree */
|
||||
ret = i2c_add_adapter(&i2c->adap);
|
||||
if (ret) {
|
||||
xiic_deinit(i2c);
|
||||
goto err_pm_disable;
|
||||
goto err_clk_dis;
|
||||
}
|
||||
|
||||
if (pdata) {
|
||||
|
@ -892,10 +897,10 @@ static int xiic_i2c_probe(struct platform_device *pdev)
|
|||
|
||||
return 0;
|
||||
|
||||
err_pm_disable:
|
||||
err_clk_dis:
|
||||
pm_runtime_set_suspended(&pdev->dev);
|
||||
pm_runtime_disable(&pdev->dev);
|
||||
|
||||
clk_disable_unprepare(i2c->clk);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -913,6 +918,7 @@ static int xiic_i2c_remove(struct platform_device *pdev)
|
|||
|
||||
xiic_deinit(i2c);
|
||||
pm_runtime_put_sync(i2c->dev);
|
||||
clk_disable_unprepare(i2c->clk);
|
||||
pm_runtime_disable(&pdev->dev);
|
||||
pm_runtime_set_suspended(&pdev->dev);
|
||||
pm_runtime_dont_use_autosuspend(&pdev->dev);
|
||||
|
|
Loading…
Add table
Reference in a new issue