aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi-sh-msiof.c
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>2013-11-28 02:39:43 +0100
committerMark Brown <broonie@linaro.org>2013-11-28 10:26:58 +0000
commit5c32d29f13e9f7b94e0e82bf3ed7a1cf6b0c0dd3 (patch)
tree06edd13bfd62ce66ee568865e5e8c63d78d301d2 /drivers/spi/spi-sh-msiof.c
parentspi: sh-msiof: Use devm_* managed allocators (diff)
downloadlinux-dev-5c32d29f13e9f7b94e0e82bf3ed7a1cf6b0c0dd3.tar.xz
linux-dev-5c32d29f13e9f7b94e0e82bf3ed7a1cf6b0c0dd3.zip
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/spi-sh-msiof.c')
-rw-r--r--drivers/spi/spi-sh-msiof.c8
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)
goto err1;
}
+ ret = clk_prepare(p->clk);
+ if (ret < 0) {
+ dev_err(&pdev->dev, "unable to prepare clock\n");
+ goto err1;
+ }
+
p->pdev = pdev;
pm_runtime_enable(&pdev->dev);
@@ -718,6 +724,7 @@ static int sh_msiof_spi_probe(struct platform_device *pdev)
return 0;
pm_runtime_disable(&pdev->dev);
+ clk_unprepare(p->clk);
err1:
spi_master_put(master);
return ret;
@@ -731,6 +738,7 @@ static int sh_msiof_spi_remove(struct platform_device *pdev)
ret = spi_bitbang_stop(&p->bitbang);
if (!ret) {
pm_runtime_disable(&pdev->dev);
+ clk_unprepare(p->clk);
spi_master_put(p->bitbang.master);
}
return ret;