mmc: sdhci-tegra: free irq on error and remove
authorWolfram Sang <w.sang@pengutronix.de>
Thu, 10 Feb 2011 17:07:30 +0000 (18:07 +0100)
committerChris Ball <cjb@laptop.org>
Tue, 15 Mar 2011 17:49:35 +0000 (13:49 -0400)
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Acked-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Chris Ball <cjb@laptop.org>
drivers/mmc/host/sdhci-tegra.c

index 4823ee94a63fe2f363eb4b40ce4cbf7656cbad81..f7e1f964395fd5bb46264e98c0e474046204293b 100644 (file)
@@ -169,7 +169,7 @@ static int tegra_sdhci_pltfm_init(struct sdhci_host *host,
                if (rc) {
                        dev_err(mmc_dev(host->mmc),
                                "failed to allocate wp gpio\n");
-                       goto out_cd;
+                       goto out_irq;
                }
                tegra_gpio_enable(plat->wp_gpio);
                gpio_direction_input(plat->wp_gpio);
@@ -195,6 +195,9 @@ out_wp:
                gpio_free(plat->wp_gpio);
        }
 
+out_irq:
+       if (gpio_is_valid(plat->cd_gpio))
+               free_irq(gpio_to_irq(plat->cd_gpio), host);
 out_cd:
        if (gpio_is_valid(plat->cd_gpio)) {
                tegra_gpio_disable(plat->cd_gpio);
@@ -225,6 +228,7 @@ static void tegra_sdhci_pltfm_exit(struct sdhci_host *host)
        }
 
        if (gpio_is_valid(plat->cd_gpio)) {
+               free_irq(gpio_to_irq(plat->cd_gpio), host);
                tegra_gpio_disable(plat->cd_gpio);
                gpio_free(plat->cd_gpio);
        }