From patchwork Tue Mar 26 04:12:39 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 15640 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 49E3E23E64 for ; Tue, 26 Mar 2013 04:24:11 +0000 (UTC) Received: from mail-vb0-f45.google.com (mail-vb0-f45.google.com [209.85.212.45]) by fiordland.canonical.com (Postfix) with ESMTP id 00DF4A19751 for ; Tue, 26 Mar 2013 04:24:10 +0000 (UTC) Received: by mail-vb0-f45.google.com with SMTP id q16so1948190vbe.4 for ; Mon, 25 Mar 2013 21:24:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=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; bh=JQEVv1d/9BFBBmuzcd0ChpTX47egyILRtDSJWzil70Y=; b=o6HGfH+rILwEjMAxDokYbQGWK6dE4EapLpeGBbCsEfbuvjI2H0wkHBmTEJ8Kpo+Vlm GMaHNZVr8yrqQvY8tAwBv+ZsVcjTZGdznrXKKEEkkQtPcEBiXVNKnkrfRnKAq9L1OTxP 4ZvA3gtzeS+typ5S2xE5oMaDIlF1/p7GCUg9zpxY/WYWQB2k5LqBB5LxqnsazrbyP4av 5xKYgrk6d1O4CU0AR0rPoXo6FCORM0f88gzFgm+8Yx1YG4HHIhhWJlBqh4HG3UqS7kR7 GAd/N1fw26xB0v0MnOBWIshZbIgo3vx4h8Xc6VHumIxZKRyfNKyKIYyvxiKFeYX8JLVA cgAA== X-Received: by 10.52.76.103 with SMTP id j7mr16140068vdw.90.1364271850505; Mon, 25 Mar 2013 21:24:10 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.59.4.204 with SMTP id cg12csp54429ved; Mon, 25 Mar 2013 21:24:10 -0700 (PDT) X-Received: by 10.66.20.36 with SMTP id k4mr21709521pae.176.1364271849546; Mon, 25 Mar 2013 21:24:09 -0700 (PDT) Received: from mail-pb0-f51.google.com (mail-pb0-f51.google.com [209.85.160.51]) by mx.google.com with ESMTPS id tm7si15950561pbc.150.2013.03.25.21.24.09 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 25 Mar 2013 21:24:09 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.51 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) client-ip=209.85.160.51; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.160.51 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) smtp.mail=sachin.kamat@linaro.org Received: by mail-pb0-f51.google.com with SMTP id rr4so1845745pbb.10 for ; Mon, 25 Mar 2013 21:24:09 -0700 (PDT) X-Received: by 10.68.243.98 with SMTP id wx2mr21477863pbc.68.1364271849121; Mon, 25 Mar 2013 21:24:09 -0700 (PDT) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id mz8sm15894438pbc.9.2013.03.25.21.24.06 (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 25 Mar 2013 21:24:08 -0700 (PDT) From: Sachin Kamat To: rtc-linux@googlegroups.com Cc: a.zummo@towertech.it, akpm@linux-foundation.org, sachin.kamat@linaro.org, patches@linaro.org Subject: [PATCH v2 2/5] drivers/rtc/rtc-tps65910.c: Fix incorrect return value on error Date: Tue, 26 Mar 2013 09:42:39 +0530 Message-Id: <1364271162-18141-3-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1364271162-18141-1-git-send-email-sachin.kamat@linaro.org> References: <1364271162-18141-1-git-send-email-sachin.kamat@linaro.org> X-Gm-Message-State: ALoCoQl01DciW3IY/9TleHzb1Jx7EGR7g7KgbmCFLhgevKcw8FF6mFsI/SX2gn7V8/4D0b+pTF0n 'ret' was not initialized to correct error value before returning. Since 'irq' is also being tested for 0, we cannot return irq itself as it means function is success even though we are returning before completing the probe. Signed-off-by: Sachin Kamat Acked-by: Venu Byravarasu --- drivers/rtc/rtc-tps65910.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/rtc/rtc-tps65910.c b/drivers/rtc/rtc-tps65910.c index 26b8bd2..a9caf04 100644 --- a/drivers/rtc/rtc-tps65910.c +++ b/drivers/rtc/rtc-tps65910.c @@ -263,7 +263,7 @@ static int tps65910_rtc_probe(struct platform_device *pdev) if (irq <= 0) { dev_warn(&pdev->dev, "Wake up is not possible as irq = %d\n", irq); - return ret; + return -ENXIO; } ret = devm_request_threaded_irq(&pdev->dev, irq, NULL,