From 36d2287d2e643e7049811f542a1b12289641a5ac Mon Sep 17 00:00:00 2001 From: Thibaut Girka Date: Wed, 16 Jun 2010 16:20:59 +0200 Subject: 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. --- drivers/mfd/glamo/glamo-mci.c | 8 ++++++-- 1 file 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; } -- cgit v1.2.3