diff options
author | Wolfram Sang <w.sang@pengutronix.de> | 2011-02-10 12:07:30 -0500 |
---|---|---|
committer | Chris Ball <cjb@laptop.org> | 2011-03-15 13:49:35 -0400 |
commit | 8154b5756d3cb850f846ff38cf35cbbb7c2b45fe (patch) | |
tree | bb16bd7fddbdd5bbda162650ae4f6cbfd35b1835 /drivers/mmc | |
parent | f53fbde48ef0a5ce7733fbc84da18014d0a11cf0 (diff) |
mmc: sdhci-tegra: free irq on error and remove
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Acked-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers/mmc')
-rw-r--r-- | drivers/mmc/host/sdhci-tegra.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/mmc/host/sdhci-tegra.c b/drivers/mmc/host/sdhci-tegra.c index 4823ee94a63f..f7e1f964395f 100644 --- a/drivers/mmc/host/sdhci-tegra.c +++ b/drivers/mmc/host/sdhci-tegra.c | |||
@@ -169,7 +169,7 @@ static int tegra_sdhci_pltfm_init(struct sdhci_host *host, | |||
169 | if (rc) { | 169 | if (rc) { |
170 | dev_err(mmc_dev(host->mmc), | 170 | dev_err(mmc_dev(host->mmc), |
171 | "failed to allocate wp gpio\n"); | 171 | "failed to allocate wp gpio\n"); |
172 | goto out_cd; | 172 | goto out_irq; |
173 | } | 173 | } |
174 | tegra_gpio_enable(plat->wp_gpio); | 174 | tegra_gpio_enable(plat->wp_gpio); |
175 | gpio_direction_input(plat->wp_gpio); | 175 | gpio_direction_input(plat->wp_gpio); |
@@ -195,6 +195,9 @@ out_wp: | |||
195 | gpio_free(plat->wp_gpio); | 195 | gpio_free(plat->wp_gpio); |
196 | } | 196 | } |
197 | 197 | ||
198 | out_irq: | ||
199 | if (gpio_is_valid(plat->cd_gpio)) | ||
200 | free_irq(gpio_to_irq(plat->cd_gpio), host); | ||
198 | out_cd: | 201 | out_cd: |
199 | if (gpio_is_valid(plat->cd_gpio)) { | 202 | if (gpio_is_valid(plat->cd_gpio)) { |
200 | tegra_gpio_disable(plat->cd_gpio); | 203 | tegra_gpio_disable(plat->cd_gpio); |
@@ -225,6 +228,7 @@ static void tegra_sdhci_pltfm_exit(struct sdhci_host *host) | |||
225 | } | 228 | } |
226 | 229 | ||
227 | if (gpio_is_valid(plat->cd_gpio)) { | 230 | if (gpio_is_valid(plat->cd_gpio)) { |
231 | free_irq(gpio_to_irq(plat->cd_gpio), host); | ||
228 | tegra_gpio_disable(plat->cd_gpio); | 232 | tegra_gpio_disable(plat->cd_gpio); |
229 | gpio_free(plat->cd_gpio); | 233 | gpio_free(plat->cd_gpio); |
230 | } | 234 | } |