Skip to content

Commit

Permalink
MFD: mcp-sa11x0: complain if mcp clock is left enabled
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Russell King committed Feb 18, 2012
1 parent 2b4d9d2 commit a4b54ac
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions drivers/mfd/mcp-sa11x0.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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;
Expand Down

0 comments on commit a4b54ac

Please sign in to comment.