From patchwork Wed Apr 3 14:02:25 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Baltieri X-Patchwork-Id: 15874 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 97F8D23E21 for ; Wed, 3 Apr 2013 14:02:54 +0000 (UTC) Received: from mail-wg0-f69.google.com (mail-wg0-f69.google.com [74.125.82.69]) by fiordland.canonical.com (Postfix) with ESMTP id 68F03A1876A for ; Wed, 3 Apr 2013 14:02:54 +0000 (UTC) Received: by mail-wg0-f69.google.com with SMTP id k14sf2327063wgh.4 for ; Wed, 03 Apr 2013 07:02:54 -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=1xyG7XslMXC5IoxjHOW/SR5m+73bIzOAVxTdii28TAE=; b=cFzjqgvSVXk4zjLAL0qyq1ltcoZq2f2/e2g9zUFJt3THNq9Q2F3GLiQk7Mpdk/84xk n6Qvv7Kvo2c5B2cx+WcNh+jEO5NgCM6dMPenre9/IB0YzdZCC7deumGRhj6tTU2T6Ks6 kKrr8BvLgNmfUG+l2o+UjNHPQ9DyLi8UJliwCs3VwkKoF9bJSif2LKlyly+UeF2bE4+3 opkFUIyOPz9L8k1SA6wjaYL9QpMw7I0D9HKrUhMHIvlmZe/pcfZSSuSvlSf3VAy8bcG5 p4YXYGfk61ElUip7I2h9/dW0caD1wm5rXsiEWLeGjGJyg2DBk927R4L5XFUt6/KKhvG0 jD5w== X-Received: by 10.180.182.229 with SMTP id eh5mr4353629wic.1.1364997774356; Wed, 03 Apr 2013 07:02:54 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.180.104.10 with SMTP id ga10ls537235wib.24.gmail; Wed, 03 Apr 2013 07:02:54 -0700 (PDT) X-Received: by 10.180.76.84 with SMTP id i20mr3069520wiw.9.1364997774259; Wed, 03 Apr 2013 07:02:54 -0700 (PDT) Received: from mail-ve0-f170.google.com (mail-ve0-f170.google.com [209.85.128.170]) by mx.google.com with ESMTPS id n16si2518928wij.91.2013.04.03.07.02.53 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 03 Apr 2013 07:02:54 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.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.128.170; Received: by mail-ve0-f170.google.com with SMTP id 15so1715345vea.1 for ; Wed, 03 Apr 2013 07:02:53 -0700 (PDT) X-Received: by 10.220.106.14 with SMTP id v14mr1328185vco.2.1364997773185; Wed, 03 Apr 2013 07:02:53 -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 cg12csp171659ved; Wed, 3 Apr 2013 07:02:52 -0700 (PDT) X-Received: by 10.14.182.137 with SMTP id o9mr3769250eem.13.1364997772040; Wed, 03 Apr 2013 07:02:52 -0700 (PDT) Received: from mail-ea0-x22a.google.com (mail-ea0-x22a.google.com [2a00:1450:4013:c01::22a]) by mx.google.com with ESMTPS id t43si8541915eeg.240.2013.04.03.07.02.51 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 03 Apr 2013 07:02:52 -0700 (PDT) Received-SPF: neutral (google.com: 2a00:1450:4013:c01::22a is neither permitted nor denied by best guess record for domain of fabio.baltieri@linaro.org) client-ip=2a00:1450:4013:c01::22a; Received: by mail-ea0-f170.google.com with SMTP id a15so657599eae.1 for ; Wed, 03 Apr 2013 07:02:51 -0700 (PDT) X-Received: by 10.15.43.73 with SMTP id w49mr3384896eev.12.1364997771447; Wed, 03 Apr 2013 07:02:51 -0700 (PDT) Received: from localhost ([2a01:2003:1:1e91:8e70:5aff:feac:ad8]) by mx.google.com with ESMTPS id 44sm7950650eek.5.2013.04.03.07.02.44 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 03 Apr 2013 07:02:50 -0700 (PDT) From: Fabio Baltieri To: Felipe Balbi Cc: Mark Brown , linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, Fabio Baltieri , Linus Walleij Subject: [PATCH 1/3] usb: phy: ab8500-usb: check regulator_enable return value Date: Wed, 3 Apr 2013 16:02:25 +0200 Message-Id: <1364997747-20830-2-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: ALoCoQn5Q1L+8zY0BnzXKpQU7eVVBcFFLpJJTvRh5935EA43iwRw3gN2Oq9bMZEPkMewkPOi9j6K X-Original-Sender: fabio.baltieri@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.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: Linus Walleij Signed-off-by: Fabio Baltieri --- drivers/usb/phy/phy-ab8500-usb.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/usb/phy/phy-ab8500-usb.c b/drivers/usb/phy/phy-ab8500-usb.c index b8115b0..ac27ed2 100644 --- a/drivers/usb/phy/phy-ab8500-usb.c +++ b/drivers/usb/phy/phy-ab8500-usb.c @@ -170,7 +170,9 @@ static void ab8500_usb_regulator_enable(struct ab8500_usb *ab) { int ret, volt; - regulator_enable(ab->v_ape); + ret = regulator_enable(ab->v_ape); + if (ret) + dev_err(ab->dev, "Failed to enable v-ape\n"); if (!is_ab8500_2p0_or_earlier(ab->ab8500)) { ab->saved_v_ulpi = regulator_get_voltage(ab->v_ulpi); @@ -188,7 +190,9 @@ static void ab8500_usb_regulator_enable(struct ab8500_usb *ab) ret); } - regulator_enable(ab->v_ulpi); + ret = regulator_enable(ab->v_ulpi); + if (ret) + dev_err(ab->dev, "Failed to enable vddulpivio18\n"); if (!is_ab8500_2p0_or_earlier(ab->ab8500)) { volt = regulator_get_voltage(ab->v_ulpi); @@ -197,7 +201,9 @@ static void ab8500_usb_regulator_enable(struct ab8500_usb *ab) volt); } - regulator_enable(ab->v_musb); + ret = regulator_enable(ab->v_musb); + if (ret) + dev_err(ab->dev, "Failed to enable musb_1v8\n"); } static void ab8500_usb_regulator_disable(struct ab8500_usb *ab)