[PATCH] irqchip: st: avoid compile error when PM is disabled

From: Chris Packham
Date: Tue Jan 03 2017 - 22:47:21 EST


When power management is disabled in the kernel configuration compiler
will complain that st_irq_syscfg_resume is defined but not used. Wrap
the function definition with CONFIG_PM_SLEEP as per other users of
SIMPLE_DEV_PM_OPS.

Signed-off-by: Chris Packham <chris.packham@xxxxxxxxxxxxxxxxxxx>
---
drivers/irqchip/irq-st.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/irqchip/irq-st.c b/drivers/irqchip/irq-st.c
index 9af48a85c16f..afec640b6d65 100644
--- a/drivers/irqchip/irq-st.c
+++ b/drivers/irqchip/irq-st.c
@@ -180,6 +180,7 @@ static int st_irq_syscfg_probe(struct platform_device *pdev)
return st_irq_syscfg_enable(pdev);
}

+#ifdef CONFIG_PM_SLEEP
static int st_irq_syscfg_resume(struct device *dev)
{
struct st_irq_syscfg *ddata = dev_get_drvdata(dev);
@@ -187,6 +188,7 @@ static int st_irq_syscfg_resume(struct device *dev)
return regmap_update_bits(ddata->regmap, ddata->syscfg,
ST_A9_IRQ_MASK, ddata->config);
}
+#endif

static SIMPLE_DEV_PM_OPS(st_irq_syscfg_pm_ops, NULL, st_irq_syscfg_resume);

--
2.11.0.24.ge6920cf