From patchwork Thu Jan 21 13:33:57 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 74336 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.2) with ESMTP id o0LDZW84014804 for ; Thu, 21 Jan 2010 13:35:32 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754073Ab0AUNf0 (ORCPT ); Thu, 21 Jan 2010 08:35:26 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753885Ab0AUNfJ (ORCPT ); Thu, 21 Jan 2010 08:35:09 -0500 Received: from smtp.nokia.com ([192.100.105.134]:18682 "EHLO mgw-mx09.nokia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753808Ab0AUNfH (ORCPT ); Thu, 21 Jan 2010 08:35:07 -0500 Received: from esebh105.NOE.Nokia.com (esebh105.ntc.nokia.com [172.21.138.211]) by mgw-mx09.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id o0LDYPK6014342; Thu, 21 Jan 2010 07:35:05 -0600 Received: from esebh102.NOE.Nokia.com ([172.21.138.183]) by esebh105.NOE.Nokia.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 21 Jan 2010 15:34:51 +0200 Received: from mgw-da02.ext.nokia.com ([147.243.128.26]) by esebh102.NOE.Nokia.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.3959); Thu, 21 Jan 2010 15:34:50 +0200 Received: from localhost.localdomain (esdhcp04088.research.nokia.com [172.21.40.88]) by mgw-da02.ext.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id o0LDYYxh005740; Thu, 21 Jan 2010 15:34:46 +0200 From: Felipe Balbi To: Greg KH Cc: Linux USB Mailing List , Linux OMAP Mailing List , Felipe Balbi Subject: [PATCH 6/7] usb: musb: unmap base if we can't probe Date: Thu, 21 Jan 2010 15:33:57 +0200 Message-Id: <1264080838-9452-7-git-send-email-felipe.balbi@nokia.com> X-Mailer: git-send-email 1.6.6.rc0 In-Reply-To: <1264080838-9452-1-git-send-email-felipe.balbi@nokia.com> References: <1264080838-9452-1-git-send-email-felipe.balbi@nokia.com> X-OriginalArrivalTime: 21 Jan 2010 13:34:51.0343 (UTC) FILETIME=[8233E5F0:01CA9A9E] X-Nokia-AV: Clean Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c index 3e9b3b0..de7b377 100644 --- a/drivers/usb/musb/musb_core.c +++ b/drivers/usb/musb/musb_core.c @@ -2110,6 +2110,7 @@ static int __init musb_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; int irq = platform_get_irq(pdev, 0); + int status; struct resource *iomem; void __iomem *base; @@ -2127,7 +2128,12 @@ static int __init musb_probe(struct platform_device *pdev) /* clobbered by use_dma=n */ orig_dma_mask = dev->dma_mask; #endif - return musb_init_controller(dev, irq, base); + + status = musb_init_controller(dev, irq, base); + if (status < 0) + iounmap(base); + + return status; } static int __exit musb_remove(struct platform_device *pdev)