Skip to content

Commit

Permalink
i2c: stu300: use clk_prepare/unprepare
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Linus Walleij authored and Wolfram Sang committed Jul 9, 2012
1 parent a55b44a commit a3f24c0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/i2c/busses/i2c-stu300.c
Original file line number Diff line number Diff line change
Expand Up @@ -924,7 +924,7 @@ stu300_probe(struct platform_device *pdev)

dev->speed = scl_frequency;

clk_enable(dev->clk);
clk_prepare_enable(dev->clk);
ret = stu300_init_hw(dev);
clk_disable(dev->clk);

Expand Down Expand Up @@ -960,6 +960,7 @@ stu300_probe(struct platform_device *pdev)

err_add_adapter:
err_init_hw:
clk_unprepare(dev->clk);
free_irq(dev->irq, dev);
err_no_irq:
iounmap(dev->virtbase);
Expand Down Expand Up @@ -1016,6 +1017,7 @@ stu300_remove(struct platform_device *pdev)
free_irq(dev->irq, dev);
iounmap(dev->virtbase);
release_mem_region(dev->phybase, dev->physize);
clk_unprepare(dev->clk);
clk_put(dev->clk);
platform_set_drvdata(pdev, NULL);
kfree(dev);
Expand Down

0 comments on commit a3f24c0

Please sign in to comment.