From patchwork Wed Apr 3 14:02:27 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Baltieri X-Patchwork-Id: 15876 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id A5FC423E21 for ; Wed, 3 Apr 2013 14:03:34 +0000 (UTC) Received: from mail-qe0-f71.google.com (mail-qe0-f71.google.com [209.85.128.71]) by fiordland.canonical.com (Postfix) with ESMTP id 4D29CA1876B for ; Wed, 3 Apr 2013 14:03:34 +0000 (UTC) Received: by mail-qe0-f71.google.com with SMTP id 7sf2589752qeb.2 for ; Wed, 03 Apr 2013 07:03:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:x-beenthere:x-received:received-spf :x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:x-received:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe; bh=6h5Nswqxv1H7u3e7GzKHx4WxrhHRv/hffwexnc5L15A=; b=KMZ3N9JJE+vmyiG5oTtiDRPG0dX7Rk8nFqTPBy4eIOdBOPSncQF7x4BBW8QLFQYMVj UGqPj9M2styefX9Lzb0XJYhvwY0qSZsnw3WYiD2vXtijhQi/uVEnNHoAIUAl1CaSsQBu MYbnrBeCyiR3HxQSZ828KeZzQI8OS3ZVowCD2CxAH4wJCh/pdCDA5YaL78dhwi5e534e YtQnjYrOtabcoNyhBBRL70Mc0Q1T2FWNrZaUTH1dQZjlPpP1iVzaJrdDVwF1yPuA8fx5 9eP1Nzz2D9pqSdza2JleSF0ETAX2iuGHO7ivYebRHkgzG9jLHcsb4J6/OA9iTezwDi/3 oQsA== X-Received: by 10.224.172.200 with SMTP id m8mr1163203qaz.0.1364997813755; Wed, 03 Apr 2013 07:03:33 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.131.201 with SMTP id oo9ls901418qeb.66.gmail; Wed, 03 Apr 2013 07:03:33 -0700 (PDT) X-Received: by 10.52.24.229 with SMTP id x5mr1091162vdf.84.1364997796836; Wed, 03 Apr 2013 07:03:16 -0700 (PDT) Received: from mail-vb0-x22e.google.com (mail-vb0-x22e.google.com [2607:f8b0:400c:c02::22e]) by mx.google.com with ESMTPS id sx2si4910795vdc.123.2013.04.03.07.03.16 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 03 Apr 2013 07:03:16 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c02::22e is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c02::22e; Received: by mail-vb0-f46.google.com with SMTP id 11so468367vbe.33 for ; Wed, 03 Apr 2013 07:03:16 -0700 (PDT) X-Received: by 10.52.20.239 with SMTP id q15mr1101004vde.73.1364997796732; Wed, 03 Apr 2013 07:03:16 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.59.4.204 with SMTP id cg12csp171676ved; Wed, 3 Apr 2013 07:03:16 -0700 (PDT) X-Received: by 10.15.34.198 with SMTP id e46mr3725001eev.27.1364997795558; Wed, 03 Apr 2013 07:03:15 -0700 (PDT) Received: from mail-ea0-x229.google.com (mail-ea0-x229.google.com [2a00:1450:4013:c01::229]) by mx.google.com with ESMTPS id w41si8604128eel.95.2013.04.03.07.03.15 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 03 Apr 2013 07:03:15 -0700 (PDT) Received-SPF: neutral (google.com: 2a00:1450:4013:c01::229 is neither permitted nor denied by best guess record for domain of fabio.baltieri@linaro.org) client-ip=2a00:1450:4013:c01::229; Received: by mail-ea0-f169.google.com with SMTP id n15so691966ead.0 for ; Wed, 03 Apr 2013 07:03:15 -0700 (PDT) X-Received: by 10.15.61.8 with SMTP id h8mr3656824eex.33.1364997795054; Wed, 03 Apr 2013 07:03:15 -0700 (PDT) Received: from localhost ([2a01:2003:1:1e91:8e70:5aff:feac:ad8]) by mx.google.com with ESMTPS id s3sm7957291eem.4.2013.04.03.07.03.08 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 03 Apr 2013 07:03:14 -0700 (PDT) From: Fabio Baltieri To: Felipe Balbi Cc: Mark Brown , linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, Fabio Baltieri , Hema HK Subject: [PATCH 3/3] usb: phy: twl6030-usb: check regulator_enable return value Date: Wed, 3 Apr 2013 16:02:27 +0200 Message-Id: <1364997747-20830-4-git-send-email-fabio.baltieri@linaro.org> X-Mailer: git-send-email 1.8.1.3 In-Reply-To: <1364997747-20830-1-git-send-email-fabio.baltieri@linaro.org> References: <1364997747-20830-1-git-send-email-fabio.baltieri@linaro.org> X-Gm-Message-State: ALoCoQk1HlK79gfkS4aP5HWd0NpodFPxYROd6S/ez2rIj4lr/cumW/7YRBnApM7/rnia9VgafhQe X-Original-Sender: fabio.baltieri@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c02::22e is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Since regulator_enable() is going to be marked as __must_check in the next merge window, always check regulator_enable() return value and print a warning if it fails. Cc: Hema HK Signed-off-by: Fabio Baltieri --- drivers/usb/phy/phy-twl6030-usb.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/usb/phy/phy-twl6030-usb.c b/drivers/usb/phy/phy-twl6030-usb.c index 8cd6cf4..e841474 100644 --- a/drivers/usb/phy/phy-twl6030-usb.c +++ b/drivers/usb/phy/phy-twl6030-usb.c @@ -211,6 +211,7 @@ static irqreturn_t twl6030_usb_irq(int irq, void *_twl) struct twl6030_usb *twl = _twl; enum omap_musb_vbus_id_status status = OMAP_MUSB_UNKNOWN; u8 vbus_state, hw_state; + int ret; hw_state = twl6030_readb(twl, TWL6030_MODULE_ID0, STS_HW_CONDITIONS); @@ -218,7 +219,10 @@ static irqreturn_t twl6030_usb_irq(int irq, void *_twl) CONTROLLER_STAT1); if (!(hw_state & STS_USB_ID)) { if (vbus_state & VBUS_DET) { - regulator_enable(twl->usb3v3); + ret = regulator_enable(twl->usb3v3); + if (ret) + dev_err(twl->dev, "Failed to enable usb3v3\n"); + twl->asleep = 1; status = OMAP_MUSB_VBUS_VALID; twl->linkstat = status; @@ -245,12 +249,15 @@ static irqreturn_t twl6030_usbotg_irq(int irq, void *_twl) struct twl6030_usb *twl = _twl; enum omap_musb_vbus_id_status status = OMAP_MUSB_UNKNOWN; u8 hw_state; + int ret; hw_state = twl6030_readb(twl, TWL6030_MODULE_ID0, STS_HW_CONDITIONS); if (hw_state & STS_USB_ID) { + ret = regulator_enable(twl->usb3v3); + if (ret) + dev_err(twl->dev, "Failed to enable usb3v3\n"); - regulator_enable(twl->usb3v3); twl->asleep = 1; twl6030_writeb(twl, TWL_MODULE_USB, 0x1, USB_ID_INT_EN_HI_CLR); twl6030_writeb(twl, TWL_MODULE_USB, 0x10, USB_ID_INT_EN_HI_SET);