From patchwork Mon May 16 12:24:07 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Munegowda, Keshava" X-Patchwork-Id: 787862 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.3) with ESMTP id p4GCSZAm000618 for ; Mon, 16 May 2011 12:28:36 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754977Ab1EPM2T (ORCPT ); Mon, 16 May 2011 08:28:19 -0400 Received: from bear.ext.ti.com ([192.94.94.41]:38870 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754939Ab1EPM2S (ORCPT ); Mon, 16 May 2011 08:28:18 -0400 Received: from dbdp20.itg.ti.com ([172.24.170.38]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id p4GCSE4Z016422 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 16 May 2011 07:28:16 -0500 Received: from dbde70.ent.ti.com (localhost [127.0.0.1]) by dbdp20.itg.ti.com (8.13.8/8.13.8) with ESMTP id p4GCS9kI016017; Mon, 16 May 2011 17:58:09 +0530 (IST) Received: from dbdp31.itg.ti.com (172.24.170.98) by DBDE70.ent.ti.com (172.24.170.148) with Microsoft SMTP Server id 8.3.106.1; Mon, 16 May 2011 17:58:08 +0530 Received: from localhost.localdomain (a0393220-desktop.india.ti.com [172.24.136.86]) by dbdp31.itg.ti.com (8.13.8/8.13.8) with ESMTP id p4GCS6Oh024983; Mon, 16 May 2011 17:58:07 +0530 (IST) From: Keshava Munegowda To: , , CC: Keshava Munegowda , , , , , Subject: [PATCH v1] mfd: Fix omap_usbhs_alloc_children error handling Date: Mon, 16 May 2011 17:54:07 +0530 Message-ID: <1305548647-19849-1-git-send-email-keshava_mgowda@ti.com> X-Mailer: git-send-email 1.6.0.4 MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Mon, 16 May 2011 12:28:36 +0000 (UTC) From: Axel Lin rebased on top of hwmod and runtime pm patch series of usbhs Signed-off-by: Axel Lin Tested-by: Keshava Munegowda Acked-by: Felipe Balbi --- drivers/mfd/omap-usb-host.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/drivers/mfd/omap-usb-host.c b/drivers/mfd/omap-usb-host.c index e1bc3b5..32d19e2 100644 --- a/drivers/mfd/omap-usb-host.c +++ b/drivers/mfd/omap-usb-host.c @@ -282,6 +282,7 @@ static int omap_usbhs_alloc_children(struct platform_device *pdev) if (!ehci) { dev_err(dev, "omap_usbhs_alloc_child failed\n"); + ret = -ENOMEM; goto err_end; } @@ -305,13 +306,14 @@ static int omap_usbhs_alloc_children(struct platform_device *pdev) sizeof(*ohci_data), dev); if (!ohci) { dev_err(dev, "omap_usbhs_alloc_child failed\n"); + ret = -ENOMEM; goto err_ehci; } return 0; err_ehci: - platform_device_put(ehci); + platform_device_unregister(ehci); err_end: return ret;