From patchwork Mon Mar 25 10:45:24 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 15586 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 4B09F23E64 for ; Mon, 25 Mar 2013 10:56:58 +0000 (UTC) Received: from mail-la0-f42.google.com (mail-la0-f42.google.com [209.85.215.42]) by fiordland.canonical.com (Postfix) with ESMTP id 1B463A192F2 for ; Mon, 25 Mar 2013 10:56:58 +0000 (UTC) Received: by mail-la0-f42.google.com with SMTP id fe20so11084227lab.1 for ; Mon, 25 Mar 2013 03:56:57 -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=BuBMyRUhxmSw+zDkv5ohMWEfi6CQrSdhDZth0iL9wvk=; b=HvjmYlGO+jQPz4VVsK2dgy+PfD/o9vXDCUlpCbPimErcZiG9reMz85Q31CN2LvdYEF zjczt2ys31rnaN/3N8STfZloEwx0tDR/rs/TeCc5gpghSJXvpKe/meMEE7traYGEDReX maW7IqY0gYo9tagradfX2Am4J52WCnzYeCfTCaWax+pwldtHRj/ExZj2ylZbjG5WNcx3 2bSS8QFgv2DCoSQBBvRoCgdTUdlE6PUYFVxN3PaouFrxy2oCjbpCWR72iglr8W8LjtGY UtvJ+3K+nBxHvGzIrPr4U9eJzahSmI9Ldf8kY7pj6qMpNlaXbc6U177AAEWAyvWKLpzG sbwA== X-Received: by 10.152.114.164 with SMTP id jh4mr5769095lab.1.1364209017714; Mon, 25 Mar 2013 03:56:57 -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.112.147.5 with SMTP id tg5csp41240lbb; Mon, 25 Mar 2013 03:56:56 -0700 (PDT) X-Received: by 10.66.252.162 with SMTP id zt2mr17675864pac.1.1364209016229; Mon, 25 Mar 2013 03:56:56 -0700 (PDT) Received: from mail-pb0-f45.google.com (mail-pb0-f45.google.com [209.85.160.45]) by mx.google.com with ESMTPS id ed2si12817661pbb.335.2013.03.25.03.56.55 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 25 Mar 2013 03:56:56 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.45 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) client-ip=209.85.160.45; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.160.45 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-f45.google.com with SMTP id ro8so4133603pbb.4 for ; Mon, 25 Mar 2013 03:56:55 -0700 (PDT) X-Received: by 10.68.59.199 with SMTP id b7mr17019428pbr.167.1364209015384; Mon, 25 Mar 2013 03:56:55 -0700 (PDT) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id y1sm13067861pbg.10.2013.03.25.03.56.52 (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 25 Mar 2013 03:56:54 -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, Venu Byravarasu Subject: [PATCH 3/6] drivers/rtc/rtc-tps65910.c: Fix incorrect return value on error Date: Mon, 25 Mar 2013 16:15:24 +0530 Message-Id: <1364208327-14207-4-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1364208327-14207-1-git-send-email-sachin.kamat@linaro.org> References: <1364208327-14207-1-git-send-email-sachin.kamat@linaro.org> X-Gm-Message-State: ALoCoQkgsbPW4IGL8OztwTQ1kx/4YLOW22i3P8mHBw8lSfU/13WaYBEDxOVMDbrTnpVoPocVJF4r '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 Cc: Venu Byravarasu 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,