Skip to content

Commit

Permalink
MMC: jz4740: Fixed card change detection.
Browse files Browse the repository at this point in the history
The GPIO validity check was reversed.
Also removed some dead code.
  • Loading branch information
mthuurne committed Jul 19, 2010
1 parent cf30fb6 commit a267b41
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions drivers/mmc/host/jz4740_mmc.c
Expand Up @@ -761,24 +761,20 @@ static int __devinit jz4740_mmc_request_gpios(struct platform_device *pdev)
static int __devinit jz4740_mmc_request_cd_irq(struct platform_device *pdev, static int __devinit jz4740_mmc_request_cd_irq(struct platform_device *pdev,
struct jz4740_mmc_host *host) struct jz4740_mmc_host *host)
{ {
int ret;
struct jz4740_mmc_platform_data *pdata = pdev->dev.platform_data; struct jz4740_mmc_platform_data *pdata = pdev->dev.platform_data;


if (gpio_is_valid(pdata->gpio_card_detect)) if (!gpio_is_valid(pdata->gpio_card_detect))
return 0; return 0;


host->card_detect_irq = gpio_to_irq(pdata->gpio_card_detect); host->card_detect_irq = gpio_to_irq(pdata->gpio_card_detect);

if (host->card_detect_irq < 0) { if (host->card_detect_irq < 0) {
dev_warn(&pdev->dev, "Failed to get card detect irq\n"); dev_warn(&pdev->dev, "Failed to get card detect irq\n");
return 0; return 0;
} }

return request_irq(host->card_detect_irq, jz4740_mmc_card_detect_irq, return request_irq(host->card_detect_irq, jz4740_mmc_card_detect_irq,
IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
"MMC card detect", host); "MMC card detect", host);


return ret;
} }


static void jz4740_mmc_free_gpios(struct platform_device *pdev) static void jz4740_mmc_free_gpios(struct platform_device *pdev)
Expand Down

0 comments on commit a267b41

Please sign in to comment.