diff options
author | Roger Quadros <ext-roger.quadros@nokia.com> | 2009-08-10 07:49:51 -0400 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2009-08-10 07:49:51 -0400 |
commit | 22833044fbe2764d44ae03f58508e671652ca186 (patch) | |
tree | ac80af411b34c65a3e5ecbed9fcaa23719fdb47d /arch/arm/mach-omap2/mmc-twl4030.c | |
parent | dfc27b34496923b5f552eb9cdf20468045114ada (diff) |
OMAP2/3: mmc-twl4030: Free up MMC regulators while cleaning up
twl_mmc_cleanup() must free up the regulators that were
allocated by twl_mmc_late_init().
This eliminates the below error when 'omap_hsmmc' module is
repeatedly loaded and unloaded.
"sysfs: cannot create duplicate filename '/devices/platform
/mmci-omap-hs.0/microamps_requested_vmmc'"
Signed-off-by: Roger Quadros <ext-roger.quadros@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap2/mmc-twl4030.c')
-rw-r--r-- | arch/arm/mach-omap2/mmc-twl4030.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/mmc-twl4030.c b/arch/arm/mach-omap2/mmc-twl4030.c index 1541fd4c8d0f..3c04c2f1b23f 100644 --- a/arch/arm/mach-omap2/mmc-twl4030.c +++ b/arch/arm/mach-omap2/mmc-twl4030.c | |||
@@ -119,6 +119,7 @@ static int twl_mmc_late_init(struct device *dev) | |||
119 | if (i != 0) | 119 | if (i != 0) |
120 | break; | 120 | break; |
121 | ret = PTR_ERR(reg); | 121 | ret = PTR_ERR(reg); |
122 | hsmmc[i].vcc = NULL; | ||
122 | goto err; | 123 | goto err; |
123 | } | 124 | } |
124 | hsmmc[i].vcc = reg; | 125 | hsmmc[i].vcc = reg; |
@@ -165,8 +166,13 @@ done: | |||
165 | static void twl_mmc_cleanup(struct device *dev) | 166 | static void twl_mmc_cleanup(struct device *dev) |
166 | { | 167 | { |
167 | struct omap_mmc_platform_data *mmc = dev->platform_data; | 168 | struct omap_mmc_platform_data *mmc = dev->platform_data; |
169 | int i; | ||
168 | 170 | ||
169 | gpio_free(mmc->slots[0].switch_pin); | 171 | gpio_free(mmc->slots[0].switch_pin); |
172 | for(i = 0; i < ARRAY_SIZE(hsmmc); i++) { | ||
173 | regulator_put(hsmmc[i].vcc); | ||
174 | regulator_put(hsmmc[i].vcc_aux); | ||
175 | } | ||
170 | } | 176 | } |
171 | 177 | ||
172 | #ifdef CONFIG_PM | 178 | #ifdef CONFIG_PM |