@@ -1405,16 +1405,10 @@ static int i2c_imx_probe(struct platform_device *pdev)
ACPI_COMPANION_SET(&i2c_imx->adapter.dev, ACPI_COMPANION(&pdev->dev));
/* Get I2C clock */
- i2c_imx->clk = devm_clk_get(&pdev->dev, NULL);
+ i2c_imx->clk = devm_clk_get_enabled(&pdev->dev, NULL);
if (IS_ERR(i2c_imx->clk))
return dev_err_probe(&pdev->dev, PTR_ERR(i2c_imx->clk),
- "can't get I2C clock\n");
-
- ret = clk_prepare_enable(i2c_imx->clk);
- if (ret) {
- dev_err(&pdev->dev, "can't enable I2C clock, ret=%d\n", ret);
- return ret;
- }
+ "can't get prepared I2C clock\n");
/* Init queue */
init_waitqueue_head(&i2c_imx->queue);
@@ -1487,7 +1481,6 @@ static int i2c_imx_probe(struct platform_device *pdev)
pm_runtime_disable(&pdev->dev);
pm_runtime_set_suspended(&pdev->dev);
pm_runtime_dont_use_autosuspend(&pdev->dev);
- clk_disable_unprepare(i2c_imx->clk);
return ret;
}
@@ -1517,7 +1510,6 @@ static int i2c_imx_remove(struct platform_device *pdev)
irq = platform_get_irq(pdev, 0);
if (irq >= 0)
free_irq(irq, i2c_imx);
- clk_disable_unprepare(i2c_imx->clk);
pm_runtime_put_noidle(&pdev->dev);
pm_runtime_disable(&pdev->dev);