Makes the function omap_mcspi_runtime_resume depend on CONFIG_PM_RUNTIME.

Signed-off-by: Felipe Balbi <[email protected]>
Signed-off-by: Shubhrajyoti D <[email protected]>
---
 drivers/spi/spi-omap2-mcspi.c |   41 +++++++++++++++++++++++------------------
 1 files changed, 23 insertions(+), 18 deletions(-)

diff --git a/drivers/spi/spi-omap2-mcspi.c b/drivers/spi/spi-omap2-mcspi.c
index cb2c0e3..f9d694d 100644
--- a/drivers/spi/spi-omap2-mcspi.c
+++ b/drivers/spi/spi-omap2-mcspi.c
@@ -248,23 +248,6 @@ static void omap2_mcspi_set_master_mode(struct spi_master 
*master)
        omap2_mcspi_ctx[master->bus_num - 1].modulctrl = l;
 }
 
-static void omap2_mcspi_restore_ctx(struct omap2_mcspi *mcspi)
-{
-       struct spi_master *spi_cntrl;
-       struct omap2_mcspi_cs *cs;
-       spi_cntrl = mcspi->master;
-
-       /* McSPI: context restore */
-       mcspi_write_reg(spi_cntrl, OMAP2_MCSPI_MODULCTRL,
-                       omap2_mcspi_ctx[spi_cntrl->bus_num - 1].modulctrl);
-
-       mcspi_write_reg(spi_cntrl, OMAP2_MCSPI_WAKEUPENABLE,
-                       omap2_mcspi_ctx[spi_cntrl->bus_num - 1].wakeupenable);
-
-       list_for_each_entry(cs, &omap2_mcspi_ctx[spi_cntrl->bus_num - 1].cs,
-                       node)
-               __raw_writel(cs->chconf0, cs->base + OMAP2_MCSPI_CHCONF0);
-}
 static void omap2_mcspi_disable_clocks(struct omap2_mcspi *mcspi)
 {
        pm_runtime_put_sync(mcspi->dev);
@@ -1066,6 +1049,26 @@ static int __init omap2_mcspi_master_setup(struct 
omap2_mcspi *mcspi)
        return 0;
 }
 
+#ifdef CONFIG_PM_RUNTIME
+static void omap2_mcspi_restore_ctx(struct omap2_mcspi *mcspi)
+{
+       struct spi_master *spi_cntrl;
+       struct omap2_mcspi_cs *cs;
+
+       spi_cntrl = mcspi->master;
+
+       /* McSPI: context restore */
+       mcspi_write_reg(spi_cntrl, OMAP2_MCSPI_MODULCTRL,
+                       omap2_mcspi_ctx[spi_cntrl->bus_num - 1].modulctrl);
+
+       mcspi_write_reg(spi_cntrl, OMAP2_MCSPI_WAKEUPENABLE,
+                       omap2_mcspi_ctx[spi_cntrl->bus_num - 1].wakeupenable);
+
+       list_for_each_entry(cs, &omap2_mcspi_ctx[spi_cntrl->bus_num - 1].cs,
+                       node)
+               __raw_writel(cs->chconf0, cs->base + OMAP2_MCSPI_CHCONF0);
+}
+
 static int omap_mcspi_runtime_resume(struct device *dev)
 {
        struct omap2_mcspi      *mcspi;
@@ -1077,7 +1080,9 @@ static int omap_mcspi_runtime_resume(struct device *dev)
 
        return 0;
 }
-
+#else
+#define        omap_mcspi_runtime_resume       NULL
+#endif
 
 static int __devinit omap2_mcspi_probe(struct platform_device *pdev)
 {
-- 
1.7.1


------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
spi-devel-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/spi-devel-general

Reply via email to