From patchwork Sat Mar 9 08:49:41 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Axel Lin X-Patchwork-Id: 2241361 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 4D9F13FCF6 for ; Sat, 9 Mar 2013 08:54:32 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UEFTe-0007St-73; Sat, 09 Mar 2013 08:50:02 +0000 Received: from mail-ie0-x236.google.com ([2607:f8b0:4001:c03::236]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UEFTY-0007Sa-E0 for linux-arm-kernel@lists.infradead.org; Sat, 09 Mar 2013 08:49:58 +0000 Received: by mail-ie0-f182.google.com with SMTP id k14so3005935iea.41 for ; Sat, 09 Mar 2013 00:49:54 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:message-id:subject:from:to:cc:date:content-type:x-mailer :content-transfer-encoding:mime-version:x-gm-message-state; bh=0DY/rnDF28Qi9DOeeW3b9xmRkMj73+E2ivH0nx9k96U=; b=C3pGx1NSm1XL4om5QFzJ1Dp/nsbG1ZRN3bKExYyzEeYKvUFt9Wtn9dC4gULQ77eYEq xtOlazIkobGdpDu+LMnsoFY2exSTNkpmjX/g2NS3vAlPEEkXpbkcIac/2E3v6Y24O/+C sJ4EBVCGN69prGEwauxXynvUxt7LRjyPfrMrGeV9M39olyLf0v9csgawca8WBsSAiZJT ireX9VewEsypLxWCpCL9I5tctrFfguRcuNBTL0axmWStZ2v3TIdet0Hg6Qrpb8+JSHuy p3hglCSrVSqa1amQyLZ+1kiIxUR30aMFyuaZlK5Galqi3QzGASFZfPybjkkcfucntmgY +A3Q== X-Received: by 10.42.215.196 with SMTP id hf4mr3566075icb.23.1362818994256; Sat, 09 Mar 2013 00:49:54 -0800 (PST) Received: from [192.168.0.102] (218-173-169-152.dynamic.hinet.net. [218.173.169.152]) by mx.google.com with ESMTPS id l2sm3356522igb.1.2013.03.09.00.49.49 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 09 Mar 2013 00:49:52 -0800 (PST) Message-ID: <1362818981.6371.1.camel@phoenix> Subject: [PATCH] mfd: ab8500-gpadc: Complain if we fail to enable vtvout LDO From: Axel Lin To: Samuel Ortiz Date: Sat, 09 Mar 2013 16:49:41 +0800 X-Mailer: Evolution 3.2.3-0ubuntu6 Mime-Version: 1.0 X-Gm-Message-State: ALoCoQk0jI+0CjBx06VFNP5DVGg/DnYaN+HDNVpFHD9GZ3Rcm9AwAumEgwibtUNEK5MhIA7xAAo/ X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130309_034956_574543_02574145 X-CRM114-Status: GOOD ( 10.89 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Linus Walleij , Arun Murthy , Lee Jones , linux-arm-kernel@lists.infradead.org, Srinidhi Kasagar X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Since commit c8801a8e "regulator: core: Mark all get and enable calls as __must_check", we must check return value of regulator_enable() to silence below build warning. CC drivers/mfd/ab8500-gpadc.o drivers/mfd/ab8500-gpadc.c: In function 'ab8500_gpadc_runtime_resume': drivers/mfd/ab8500-gpadc.c:598:18: warning: ignoring return value of 'regulator_enable', declared with attribute warn_unused_result [-Wunused-result] drivers/mfd/ab8500-gpadc.c: In function 'ab8500_gpadc_probe': drivers/mfd/ab8500-gpadc.c:655:18: warning: ignoring return value of 'regulator_enable', declared with attribute warn_unused_result [-Wunused-result] Signed-off-by: Axel Lin --- drivers/mfd/ab8500-gpadc.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/drivers/mfd/ab8500-gpadc.c b/drivers/mfd/ab8500-gpadc.c index b1f3561..e005670 100644 --- a/drivers/mfd/ab8500-gpadc.c +++ b/drivers/mfd/ab8500-gpadc.c @@ -594,9 +594,12 @@ static int ab8500_gpadc_runtime_suspend(struct device *dev) static int ab8500_gpadc_runtime_resume(struct device *dev) { struct ab8500_gpadc *gpadc = dev_get_drvdata(dev); + int ret; - regulator_enable(gpadc->regu); - return 0; + ret = regulator_enable(gpadc->regu); + if (ret) + dev_err(dev, "Failed to enable vtvout LDO: %d\n", ret); + return ret; } static int ab8500_gpadc_runtime_idle(struct device *dev) @@ -652,7 +655,11 @@ static int ab8500_gpadc_probe(struct platform_device *pdev) platform_set_drvdata(pdev, gpadc); - regulator_enable(gpadc->regu); + ret = regulator_enable(gpadc->regu); + if (ret) { + dev_err(gpadc->dev, "Failed to enable vtvout LDO: %d\n", ret); + goto fail_enable; + } pm_runtime_set_autosuspend_delay(gpadc->dev, GPADC_AUDOSUSPEND_DELAY); pm_runtime_use_autosuspend(gpadc->dev); @@ -663,6 +670,9 @@ static int ab8500_gpadc_probe(struct platform_device *pdev) list_add_tail(&gpadc->node, &ab8500_gpadc_list); dev_dbg(gpadc->dev, "probe success\n"); return 0; + +fail_enable: + regulator_disable(gpadc->regu); fail_irq: free_irq(gpadc->irq, gpadc); fail: