From patchwork Wed Apr 3 14:02:26 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Baltieri X-Patchwork-Id: 15875 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 3ABAD23E21 for ; Wed, 3 Apr 2013 14:03:06 +0000 (UTC) Received: from mail-gg0-f200.google.com (mail-gg0-f200.google.com [209.85.161.200]) by fiordland.canonical.com (Postfix) with ESMTP id D00FDA18765 for ; Wed, 3 Apr 2013 14:03:05 +0000 (UTC) Received: by mail-gg0-f200.google.com with SMTP id i2sf2045224ggn.11 for ; Wed, 03 Apr 2013 07:03:05 -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=74mVQlGnw4BTnwVFhRwAPPj8QCU2o0/GYTTjkpQLSKo=; b=pnOocxLtQf0tK8iH5hqnoZLJRO2aYqM1suzWZxNATXAfU5PWi1onpkXHmJ9RPhggGf a2rfHo8TnGnmig67L32Dt5KpHWchYIWPWz7y8wNsUX/TtTU3U7Zdb4//FD1Tb3742pTI 8zG3+QmgPaBuQcq/SXPSle2GLFsTjDuXZn/ohEACIA9u2yWueSaFtMBKFRoVB3EdNiFk AJ7pB8YnKr2CQZHxh2BSoqe8ewwbZ3gaYDRLLMUPA1bgrUzKlwohjuhgVZUtwsGOVXx5 z6OobK9LJbLcZRbnuQuU5F7KoKCL292w+CSDxrziGPJ3UxyhARttBE59XVfirvUwfkP8 wDWw== X-Received: by 10.236.56.73 with SMTP id l49mr879353yhc.5.1364997785312; Wed, 03 Apr 2013 07:03:05 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.61.41 with SMTP id m9ls789584qer.19.gmail; Wed, 03 Apr 2013 07:03:05 -0700 (PDT) X-Received: by 10.52.26.17 with SMTP id h17mr1065317vdg.101.1364997785092; Wed, 03 Apr 2013 07:03:05 -0700 (PDT) Received: from mail-vc0-f170.google.com (mail-vc0-f170.google.com [209.85.220.170]) by mx.google.com with ESMTPS id dl5si4927059ved.17.2013.04.03.07.03.05 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 03 Apr 2013 07:03:05 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.170 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.170; Received: by mail-vc0-f170.google.com with SMTP id lf10so1505073vcb.1 for ; Wed, 03 Apr 2013 07:03:05 -0700 (PDT) X-Received: by 10.220.225.200 with SMTP id it8mr1283872vcb.39.1364997784931; Wed, 03 Apr 2013 07:03:04 -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 cg12csp171668ved; Wed, 3 Apr 2013 07:03:04 -0700 (PDT) X-Received: by 10.14.183.198 with SMTP id q46mr3881187eem.1.1364997783872; Wed, 03 Apr 2013 07:03:03 -0700 (PDT) Received: from mail-ea0-x232.google.com (mail-ea0-x232.google.com [2a00:1450:4013:c01::232]) by mx.google.com with ESMTPS id g3si8585581eev.138.2013.04.03.07.03.03 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 03 Apr 2013 07:03:03 -0700 (PDT) Received-SPF: neutral (google.com: 2a00:1450:4013:c01::232 is neither permitted nor denied by best guess record for domain of fabio.baltieri@linaro.org) client-ip=2a00:1450:4013:c01::232; Received: by mail-ea0-f178.google.com with SMTP id o10so683834eaj.37 for ; Wed, 03 Apr 2013 07:03:03 -0700 (PDT) X-Received: by 10.14.179.201 with SMTP id h49mr3694429eem.26.1364997783318; Wed, 03 Apr 2013 07:03:03 -0700 (PDT) Received: from localhost ([2a01:2003:1:1e91:8e70:5aff:feac:ad8]) by mx.google.com with ESMTPS id r4sm7911103eeo.12.2013.04.03.07.02.56 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 03 Apr 2013 07:03:02 -0700 (PDT) From: Fabio Baltieri To: Felipe Balbi Cc: Mark Brown , linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, Fabio Baltieri , Kalle Jokiniemi Subject: [PATCH 2/3] usb: phy: twl4030-usb: check regulator_enable return value Date: Wed, 3 Apr 2013 16:02:26 +0200 Message-Id: <1364997747-20830-3-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: ALoCoQmG1zuebDYFCoN0pemwXCacDEaAOVlX4Bpw/bDTQnDvVL1xo/NNDQSft7A9T1pA8jSQVUGM X-Original-Sender: fabio.baltieri@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.170 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: Kalle Jokiniemi Signed-off-by: Fabio Baltieri --- drivers/usb/phy/phy-twl4030-usb.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/drivers/usb/phy/phy-twl4030-usb.c b/drivers/usb/phy/phy-twl4030-usb.c index 3f9858f..13e17ae 100644 --- a/drivers/usb/phy/phy-twl4030-usb.c +++ b/drivers/usb/phy/phy-twl4030-usb.c @@ -384,9 +384,17 @@ static void __twl4030_phy_power(struct twl4030_usb *twl, int on) static void twl4030_phy_power(struct twl4030_usb *twl, int on) { + int ret; + if (on) { - regulator_enable(twl->usb3v1); - regulator_enable(twl->usb1v8); + ret = regulator_enable(twl->usb3v1); + if (ret) + dev_err(twl->dev, "Failed to enable usb3v1\n"); + + ret = regulator_enable(twl->usb1v8); + if (ret) + dev_err(twl->dev, "Failed to enable usb1v8\n"); + /* * Disabling usb3v1 regulator (= writing 0 to VUSB3V1_DEV_GRP * in twl4030) resets the VUSB_DEDICATED2 register. This reset @@ -395,7 +403,11 @@ static void twl4030_phy_power(struct twl4030_usb *twl, int on) * is re-activated. This ensures that VUSB3V1 is really active. */ twl_i2c_write_u8(TWL_MODULE_PM_RECEIVER, 0, VUSB_DEDICATED2); - regulator_enable(twl->usb1v5); + + ret = regulator_enable(twl->usb1v5); + if (ret) + dev_err(twl->dev, "Failed to enable usb1v5\n"); + __twl4030_phy_power(twl, 1); twl4030_usb_write(twl, PHY_CLK_CTRL, twl4030_usb_read(twl, PHY_CLK_CTRL) |