diff options
author | Magnus Damm <damm@opensource.se> | 2011-05-06 15:02:33 +0400 |
---|---|---|
committer | Chris Ball <cjb@laptop.org> | 2011-05-25 07:53:52 +0400 |
commit | 8e7bfdb37ac001c95d2c768932b57de1019409cd (patch) | |
tree | 8b91c25442de01ce415563ae60ee30eb8d7e6e3c /drivers/mmc/host/sh_mobile_sdhi.c | |
parent | df3ef2d3c92c0a562ebde3699af7d12401fddf60 (diff) | |
download | linux-8e7bfdb37ac001c95d2c768932b57de1019409cd.tar.xz |
mmc: tmio/sdhi: break out interrupt request/free
Move request_irq()/free_irq() from the shared code
in tmio_mmc.c into the SDHI/tmio specific portion
in sh_mobile_sdhi.c and tmio_mmc_pio.c.
This is ground work to allow us to adjust the SDHI
code with IRQ flags and number of interupt sources.
Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers/mmc/host/sh_mobile_sdhi.c')
-rw-r--r-- | drivers/mmc/host/sh_mobile_sdhi.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c index f60e954dec64..9ee51ace6f70 100644 --- a/drivers/mmc/host/sh_mobile_sdhi.c +++ b/drivers/mmc/host/sh_mobile_sdhi.c @@ -62,7 +62,7 @@ static int __devinit sh_mobile_sdhi_probe(struct platform_device *pdev) struct sh_mobile_sdhi_info *p = pdev->dev.platform_data; struct tmio_mmc_host *host; char clk_name[8]; - int ret; + int irq, ret; priv = kzalloc(sizeof(struct sh_mobile_sdhi), GFP_KERNEL); if (priv == NULL) { @@ -116,11 +116,24 @@ static int __devinit sh_mobile_sdhi_probe(struct platform_device *pdev) if (ret < 0) goto eprobe; + irq = platform_get_irq(pdev, 0); + if (irq < 0) { + ret = irq; + goto eirq; + } + + ret = request_irq(irq, tmio_mmc_irq, IRQF_DISABLED | + IRQF_TRIGGER_FALLING, dev_name(&pdev->dev), host); + if (ret) + goto eirq; + pr_info("%s at 0x%08lx irq %d\n", mmc_hostname(host->mmc), - (unsigned long)host->ctl, host->irq); + (unsigned long)host->ctl, irq); return ret; +eirq: + tmio_mmc_host_remove(host); eprobe: clk_disable(priv->clk); clk_put(priv->clk); @@ -135,6 +148,7 @@ static int sh_mobile_sdhi_remove(struct platform_device *pdev) struct tmio_mmc_host *host = mmc_priv(mmc); struct sh_mobile_sdhi *priv = container_of(host->pdata, struct sh_mobile_sdhi, mmc_data); + free_irq(platform_get_irq(pdev, 0), host); tmio_mmc_host_remove(host); clk_disable(priv->clk); clk_put(priv->clk); |