diff options
author | Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> | 2013-11-27 20:39:43 -0500 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-11-28 05:26:58 -0500 |
commit | 5c32d29f13e9f7b94e0e82bf3ed7a1cf6b0c0dd3 (patch) | |
tree | 06edd13bfd62ce66ee568865e5e8c63d78d301d2 /drivers/spi | |
parent | b4dd05de3d6fb93724b27921689fb3e95ba71845 (diff) |
spi: sh-msiof: Convert to clk_prepare/unprepare
Get the driver ready for the migration to the common clock framework by
calling clk_prepare() and clk_unprepare(). The calls are added in the
probe and remove handlers as the clk_enable() and clk_disable() calls
are located in atomic context and there's no callback function in
non-atomic context that can be used to prepare/unprepare the clock.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'drivers/spi')
-rw-r--r-- | drivers/spi/spi-sh-msiof.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/spi/spi-sh-msiof.c b/drivers/spi/spi-sh-msiof.c index 7f2bb8572e5c..d96b047afcd2 100644 --- a/drivers/spi/spi-sh-msiof.c +++ b/drivers/spi/spi-sh-msiof.c | |||
@@ -682,6 +682,12 @@ static int sh_msiof_spi_probe(struct platform_device *pdev) | |||
682 | goto err1; | 682 | goto err1; |
683 | } | 683 | } |
684 | 684 | ||
685 | ret = clk_prepare(p->clk); | ||
686 | if (ret < 0) { | ||
687 | dev_err(&pdev->dev, "unable to prepare clock\n"); | ||
688 | goto err1; | ||
689 | } | ||
690 | |||
685 | p->pdev = pdev; | 691 | p->pdev = pdev; |
686 | pm_runtime_enable(&pdev->dev); | 692 | pm_runtime_enable(&pdev->dev); |
687 | 693 | ||
@@ -718,6 +724,7 @@ static int sh_msiof_spi_probe(struct platform_device *pdev) | |||
718 | return 0; | 724 | return 0; |
719 | 725 | ||
720 | pm_runtime_disable(&pdev->dev); | 726 | pm_runtime_disable(&pdev->dev); |
727 | clk_unprepare(p->clk); | ||
721 | err1: | 728 | err1: |
722 | spi_master_put(master); | 729 | spi_master_put(master); |
723 | return ret; | 730 | return ret; |
@@ -731,6 +738,7 @@ static int sh_msiof_spi_remove(struct platform_device *pdev) | |||
731 | ret = spi_bitbang_stop(&p->bitbang); | 738 | ret = spi_bitbang_stop(&p->bitbang); |
732 | if (!ret) { | 739 | if (!ret) { |
733 | pm_runtime_disable(&pdev->dev); | 740 | pm_runtime_disable(&pdev->dev); |
741 | clk_unprepare(p->clk); | ||
734 | spi_master_put(p->bitbang.master); | 742 | spi_master_put(p->bitbang.master); |
735 | } | 743 | } |
736 | return ret; | 744 | return ret; |