Commit 5dd32eae authored by Vladimir Zapolskiy's avatar Vladimir Zapolskiy Committed by Wolfram Sang

i2c: pnx: fix runtime warnings caused by enabling unprepared clock

The driver can not be used on a platform with common clock framework
until clk_prepare/clk_unprepare calls are added, otherwise clk_enable
calls will fail and a WARN is generated.
Signed-off-by: default avatarVladimir Zapolskiy <vz@mleia.com>
Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
parent 0729a049
...@@ -600,7 +600,7 @@ static int i2c_pnx_controller_suspend(struct device *dev) ...@@ -600,7 +600,7 @@ static int i2c_pnx_controller_suspend(struct device *dev)
{ {
struct i2c_pnx_algo_data *alg_data = dev_get_drvdata(dev); struct i2c_pnx_algo_data *alg_data = dev_get_drvdata(dev);
clk_disable(alg_data->clk); clk_disable_unprepare(alg_data->clk);
return 0; return 0;
} }
...@@ -609,7 +609,7 @@ static int i2c_pnx_controller_resume(struct device *dev) ...@@ -609,7 +609,7 @@ static int i2c_pnx_controller_resume(struct device *dev)
{ {
struct i2c_pnx_algo_data *alg_data = dev_get_drvdata(dev); struct i2c_pnx_algo_data *alg_data = dev_get_drvdata(dev);
return clk_enable(alg_data->clk); return clk_prepare_enable(alg_data->clk);
} }
static SIMPLE_DEV_PM_OPS(i2c_pnx_pm, static SIMPLE_DEV_PM_OPS(i2c_pnx_pm,
...@@ -672,7 +672,7 @@ static int i2c_pnx_probe(struct platform_device *pdev) ...@@ -672,7 +672,7 @@ static int i2c_pnx_probe(struct platform_device *pdev)
if (IS_ERR(alg_data->ioaddr)) if (IS_ERR(alg_data->ioaddr))
return PTR_ERR(alg_data->ioaddr); return PTR_ERR(alg_data->ioaddr);
ret = clk_enable(alg_data->clk); ret = clk_prepare_enable(alg_data->clk);
if (ret) if (ret)
return ret; return ret;
...@@ -726,7 +726,7 @@ static int i2c_pnx_probe(struct platform_device *pdev) ...@@ -726,7 +726,7 @@ static int i2c_pnx_probe(struct platform_device *pdev)
return 0; return 0;
out_clock: out_clock:
clk_disable(alg_data->clk); clk_disable_unprepare(alg_data->clk);
return ret; return ret;
} }
...@@ -735,7 +735,7 @@ static int i2c_pnx_remove(struct platform_device *pdev) ...@@ -735,7 +735,7 @@ static int i2c_pnx_remove(struct platform_device *pdev)
struct i2c_pnx_algo_data *alg_data = platform_get_drvdata(pdev); struct i2c_pnx_algo_data *alg_data = platform_get_drvdata(pdev);
i2c_del_adapter(&alg_data->adapter); i2c_del_adapter(&alg_data->adapter);
clk_disable(alg_data->clk); clk_disable_unprepare(alg_data->clk);
return 0; return 0;
} }
......
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