diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2012-06-12 13:33:30 -0400 |
---|---|---|
committer | Wolfram Sang <w.sang@pengutronix.de> | 2012-07-09 08:18:05 -0400 |
commit | a3f24c0dbd0b9a7624d077b3c1841dde267aaa6c (patch) | |
tree | df05ada35254925726ab96345dc06f621cfb0992 /drivers/i2c | |
parent | a55b44ac3fe07d4e89486817732b596fce6ab9f6 (diff) |
i2c: stu300: use clk_prepare/unprepare
Make sure we prepare/unprepare the clock for the ST U300
I2C driver as is required by the clk API especially if you
use common clock.
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Diffstat (limited to 'drivers/i2c')
-rw-r--r-- | drivers/i2c/busses/i2c-stu300.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/i2c/busses/i2c-stu300.c b/drivers/i2c/busses/i2c-stu300.c index 4d44af181f37..79b785150c15 100644 --- a/drivers/i2c/busses/i2c-stu300.c +++ b/drivers/i2c/busses/i2c-stu300.c | |||
@@ -924,7 +924,7 @@ stu300_probe(struct platform_device *pdev) | |||
924 | 924 | ||
925 | dev->speed = scl_frequency; | 925 | dev->speed = scl_frequency; |
926 | 926 | ||
927 | clk_enable(dev->clk); | 927 | clk_prepare_enable(dev->clk); |
928 | ret = stu300_init_hw(dev); | 928 | ret = stu300_init_hw(dev); |
929 | clk_disable(dev->clk); | 929 | clk_disable(dev->clk); |
930 | 930 | ||
@@ -960,6 +960,7 @@ stu300_probe(struct platform_device *pdev) | |||
960 | 960 | ||
961 | err_add_adapter: | 961 | err_add_adapter: |
962 | err_init_hw: | 962 | err_init_hw: |
963 | clk_unprepare(dev->clk); | ||
963 | free_irq(dev->irq, dev); | 964 | free_irq(dev->irq, dev); |
964 | err_no_irq: | 965 | err_no_irq: |
965 | iounmap(dev->virtbase); | 966 | iounmap(dev->virtbase); |
@@ -1016,6 +1017,7 @@ stu300_remove(struct platform_device *pdev) | |||
1016 | free_irq(dev->irq, dev); | 1017 | free_irq(dev->irq, dev); |
1017 | iounmap(dev->virtbase); | 1018 | iounmap(dev->virtbase); |
1018 | release_mem_region(dev->phybase, dev->physize); | 1019 | release_mem_region(dev->phybase, dev->physize); |
1020 | clk_unprepare(dev->clk); | ||
1019 | clk_put(dev->clk); | 1021 | clk_put(dev->clk); |
1020 | platform_set_drvdata(pdev, NULL); | 1022 | platform_set_drvdata(pdev, NULL); |
1021 | kfree(dev); | 1023 | kfree(dev); |