Skip to content

Commit

Permalink
tmio_mmc: Balance cell enable()/disable() calls
Browse files Browse the repository at this point in the history
This patch adds cell->disable() calls to the tmio-mmc
probe() error handling and the remove() function.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
  • Loading branch information
Magnus Damm authored and Samuel Ortiz committed Mar 7, 2010
1 parent 707f0b2 commit 7ee422d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions drivers/mmc/host/tmio_mmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -569,14 +569,14 @@ static int __devinit tmio_mmc_probe(struct platform_device *dev)
if (ret >= 0)
host->irq = ret;
else
goto unmap_ctl;
goto cell_disable;

disable_mmc_irqs(host, TMIO_MASK_ALL);

ret = request_irq(host->irq, tmio_mmc_irq, IRQF_DISABLED |
IRQF_TRIGGER_FALLING, dev_name(&dev->dev), host);
if (ret)
goto unmap_ctl;
goto cell_disable;

mmc_add_host(mmc);

Expand All @@ -588,6 +588,9 @@ static int __devinit tmio_mmc_probe(struct platform_device *dev)

return 0;

cell_disable:
if (cell->disable)
cell->disable(dev);
unmap_ctl:
iounmap(host->ctl);
host_free:
Expand All @@ -598,6 +601,7 @@ static int __devinit tmio_mmc_probe(struct platform_device *dev)

static int __devexit tmio_mmc_remove(struct platform_device *dev)
{
struct mfd_cell *cell = (struct mfd_cell *)dev->dev.platform_data;
struct mmc_host *mmc = platform_get_drvdata(dev);

platform_set_drvdata(dev, NULL);
Expand All @@ -606,6 +610,8 @@ static int __devexit tmio_mmc_remove(struct platform_device *dev)
struct tmio_mmc_host *host = mmc_priv(mmc);
mmc_remove_host(mmc);
free_irq(host->irq, host);
if (cell->disable)
cell->disable(dev);
iounmap(host->ctl);
mmc_free_host(mmc);
}
Expand Down

0 comments on commit 7ee422d

Please sign in to comment.