summaryrefslogtreecommitdiffstats
path: root/drivers/mfd/mcp-sa11x0.c
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2012-01-21 18:26:17 +0000
committerRussell King <rmk+kernel@arm.linux.org.uk>2012-02-18 23:15:42 +0000
commita4b54acf9e691a3051950444d33980741e7d63a8 (patch)
tree3694bf15185453cf8dced6debe0ccdfc928f26bc /drivers/mfd/mcp-sa11x0.c
parent2b4d9d2b001be2ff06be2ea5c52e9adaf85b0805 (diff)
downloadop-kernel-dev-a4b54acf9e691a3051950444d33980741e7d63a8.zip
op-kernel-dev-a4b54acf9e691a3051950444d33980741e7d63a8.tar.gz
MFD: mcp-sa11x0: complain if mcp clock is left enabled
Issue a warning if the mcp clock was left enabled by some driver when we're suspending or tearing down the core driver for the device. This is an aid for debugging missing disable calls. Acked-by: Jochen Friedrich <jochen@scram.de> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers/mfd/mcp-sa11x0.c')
-rw-r--r--drivers/mfd/mcp-sa11x0.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/mfd/mcp-sa11x0.c b/drivers/mfd/mcp-sa11x0.c
index 960ebc7..c381436 100644
--- a/drivers/mfd/mcp-sa11x0.c
+++ b/drivers/mfd/mcp-sa11x0.c
@@ -252,6 +252,10 @@ static int mcp_sa11x0_remove(struct platform_device *dev)
struct mcp_sa11x0 *m = priv(mcp);
struct resource *mem0, *mem1;
+ if (m->mccr0 & MCCR0_MCE)
+ dev_warn(&dev->dev,
+ "device left active (missing disable call?)\n");
+
mem0 = platform_get_resource(dev, IORESOURCE_MEM, 0);
mem1 = platform_get_resource(dev, IORESOURCE_MEM, 1);
@@ -271,6 +275,9 @@ static int mcp_sa11x0_suspend(struct device *dev)
{
struct mcp_sa11x0 *m = priv(dev_get_drvdata(dev));
+ if (m->mccr0 & MCCR0_MCE)
+ dev_warn(dev, "device left active (missing disable call?)\n");
+
writel(m->mccr0 & ~MCCR0_MCE, MCCR0(m));
return 0;
OpenPOWER on IntegriCloud