From patchwork Tue Jun 23 13:01:10 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roger Quadros X-Patchwork-Id: 31970 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n5ND20NG015277 for ; Tue, 23 Jun 2009 13:02:00 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752818AbZFWNBz (ORCPT ); Tue, 23 Jun 2009 09:01:55 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752839AbZFWNBz (ORCPT ); Tue, 23 Jun 2009 09:01:55 -0400 Received: from smtp.nokia.com ([192.100.122.233]:21502 "EHLO mgw-mx06.nokia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752818AbZFWNBy (ORCPT ); Tue, 23 Jun 2009 09:01:54 -0400 Received: from vaebh105.NOE.Nokia.com (vaebh105.europe.nokia.com [10.160.244.31]) by mgw-mx06.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id n5ND1M4U027772; Tue, 23 Jun 2009 16:01:46 +0300 Received: from esebh102.NOE.Nokia.com ([172.21.138.183]) by vaebh105.NOE.Nokia.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 23 Jun 2009 16:01:41 +0300 Received: from mgw-sa02.ext.nokia.com ([147.243.1.48]) by esebh102.NOE.Nokia.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.3959); Tue, 23 Jun 2009 16:01:40 +0300 Received: from localhost.localdomain (esdhcp036168.research.nokia.com [172.21.36.168]) by mgw-sa02.ext.nokia.com (Switch-3.2.6/Switch-3.2.6) with ESMTP id n5ND1dYk017829; Tue, 23 Jun 2009 16:01:39 +0300 From: Roger Quadros To: tony@atomide.com Cc: linux-omap@vger.kernel.org Subject: [PATCH] OMAP2/3: mmc-twl4030: Free up MMC regulators while cleaning up Date: Tue, 23 Jun 2009 16:01:10 +0300 Message-Id: <1245762070-13302-1-git-send-email-ext-roger.quadros@nokia.com> X-Mailer: git-send-email 1.6.0.4 X-OriginalArrivalTime: 23 Jun 2009 13:01:40.0772 (UTC) FILETIME=[C027DE40:01C9F402] X-Nokia-AV: Clean Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org 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 --- 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 06b252f..0007115 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) if (i != 0) break; ret = PTR_ERR(reg); + hsmmc[i].vcc = NULL; goto err; } hsmmc[i].vcc = reg; @@ -165,8 +166,13 @@ done: static void twl_mmc_cleanup(struct device *dev) { struct omap_mmc_platform_data *mmc = dev->platform_data; + int i; gpio_free(mmc->slots[0].switch_pin); + for(i = 0; i < ARRAY_SIZE(hsmmc); i++) { + regulator_put(hsmmc[i].vcc); + regulator_put(hsmmc[i].vcc_aux); + } } #ifdef CONFIG_PM