aboutsummaryrefslogtreecommitdiff
path: root/drivers/mfd/glamo
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2010-06-16 16:20:59 +0200
committerLars-Peter Clausen <lars@metafoo.de>2010-06-19 22:36:31 +0200
commit36d2287d2e643e7049811f542a1b12289641a5ac (patch)
tree10a128d3aa1a1f5e02deab959c268010d97d7505 /drivers/mfd/glamo
parentccb79dafced9a94260dfaee1993e7e96d446d3bc (diff)
glamo-mci: safer probe
Calls mmc_host_disable instead of mmc_host_lazy_disable if an error occurs, thus avoiding to schedule a delayed work that would end up using free'd objects.
Diffstat (limited to 'drivers/mfd/glamo')
-rw-r--r--drivers/mfd/glamo/glamo-mci.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/mfd/glamo/glamo-mci.c b/drivers/mfd/glamo/glamo-mci.c
index 08d0154f37e..c0c58f173f4 100644
--- a/drivers/mfd/glamo/glamo-mci.c
+++ b/drivers/mfd/glamo/glamo-mci.c
@@ -840,16 +840,19 @@ static int glamo_mci_probe(struct platform_device *pdev)
mmc_host_enable(mmc);
glamo_mci_reset(host);
- mmc_host_lazy_disable(mmc);
ret = mmc_add_host(mmc);
if (ret) {
dev_err(&pdev->dev, "failed to add mmc host.\n");
- goto probe_freeirq;
+ goto probe_mmc_host_disable;
}
+ mmc_host_lazy_disable(mmc);
+
return 0;
+probe_mmc_host_disable:
+ mmc_host_disable(mmc);
probe_freeirq:
free_irq(host->irq, host);
probe_iounmap_data:
@@ -891,6 +894,7 @@ static int glamo_mci_remove(struct platform_device *pdev)
regulator_put(host->regulator);
mmc_free_host(mmc);
+
return 0;
}