Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 102200
b: refs/heads/master
c: 55d70f5
h: refs/heads/master
v: v3
  • Loading branch information
Ben Dooks authored and Pierre Ossman committed Jul 15, 2008
1 parent 1598b1f commit 0d401b2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7c14450ed6ab4ed453b2bf216ca3aaa7a5402af3
refs/heads/master: 55d70f5a7b25800fc8376cdd81d42d6c201fa91d
28 changes: 17 additions & 11 deletions trunk/drivers/mmc/host/s3cmci.c
Original file line number Diff line number Diff line change
Expand Up @@ -1150,8 +1150,6 @@ static int __devinit s3cmci_probe(struct platform_device *pdev, int is2440)
host->pio_active = XFER_NONE;

host->dma = S3CMCI_DMA;
host->irq_cd = s3c2410_gpio_getirq(host->pdata->gpio_detect);
s3c2410_gpio_cfgpin(host->pdata->gpio_detect, S3C2410_GPIO_IRQ);

host->mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!host->mem) {
Expand Down Expand Up @@ -1197,14 +1195,20 @@ static int __devinit s3cmci_probe(struct platform_device *pdev, int is2440)

disable_irq(host->irq);

s3c2410_gpio_cfgpin(host->pdata->gpio_detect, S3C2410_GPIO_IRQ);
set_irq_type(host->irq_cd, IRQT_BOTHEDGE);
host->irq_cd = s3c2410_gpio_getirq(host->pdata->gpio_detect);

if (request_irq(host->irq_cd, s3cmci_irq_cd, 0, DRIVER_NAME, host)) {
dev_err(&pdev->dev,
"failed to request card detect interrupt.\n");
ret = -ENOENT;
goto probe_free_irq;
if (host->irq_cd >= 0) {
if (request_irq(host->irq_cd, s3cmci_irq_cd,
IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
DRIVER_NAME, host)) {
dev_err(&pdev->dev, "can't get card detect irq.\n");
ret = -ENOENT;
goto probe_free_irq;
}
} else {
dev_warn(&pdev->dev, "host detect has no irq available\n");
s3c2410_gpio_cfgpin(host->pdata->gpio_detect,
S3C2410_GPIO_INPUT);
}

if (host->pdata->gpio_wprotect)
Expand Down Expand Up @@ -1273,7 +1277,8 @@ static int __devinit s3cmci_probe(struct platform_device *pdev, int is2440)
clk_put(host->clk);

probe_free_irq_cd:
free_irq(host->irq_cd, host);
if (host->irq_cd >= 0)
free_irq(host->irq_cd, host);

probe_free_irq:
free_irq(host->irq, host);
Expand Down Expand Up @@ -1303,7 +1308,8 @@ static int __devexit s3cmci_remove(struct platform_device *pdev)
tasklet_disable(&host->pio_tasklet);
s3c2410_dma_free(S3CMCI_DMA, &s3cmci_dma_client);

free_irq(host->irq_cd, host);
if (host->irq_cd >= 0)
free_irq(host->irq_cd, host);
free_irq(host->irq, host);

iounmap(host->base);
Expand Down

0 comments on commit 0d401b2

Please sign in to comment.