From patchwork Mon Mar 25 10:45:25 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 15587 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 1C33723E64 for ; Mon, 25 Mar 2013 10:57:01 +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 E4508A192F0 for ; Mon, 25 Mar 2013 10:57:00 +0000 (UTC) Received: by mail-la0-f42.google.com with SMTP id fe20so11084292lab.1 for ; Mon, 25 Mar 2013 03:57:00 -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=0cQQCwlzQ+qS4i9rb5lMV8sg4vSNLXWGngkAUnqd41E=; b=awg+zvMNxrymh8Cy9DR6FXE0Z98g4tulSZa/4z1JZGBo1rhoW+2xDaOAuUg9iaaAxL 8ZilaGGYFb6p4eEkNZdPKS/FdPUuCvuV+4ZxNev7NoYa01zxGWF8zGse+faX8tM9nPfN IBUoueCJM+6pPjpCBtmKtD7txdbqZso5XPBjpjb94gbCeCBJiAul58t6XMrwjxj1Ziw6 V1/YOf9C2tzLAW4M/zYW+6DYz5eMVgtojxMqvQDczXRkBEiJk/aaud+maL3EnV0tFQSG hWB9xFVK9t8D56G3G0r7wkEX2lBrUyqR6ttsaJ+PGdqL2dMm44MKLj2gKTVigFMFe0oE Wwcg== X-Received: by 10.152.106.5 with SMTP id gq5mr5851964lab.5.1364209020537; Mon, 25 Mar 2013 03:57:00 -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 tg5csp41242lbb; Mon, 25 Mar 2013 03:56:59 -0700 (PDT) X-Received: by 10.68.225.195 with SMTP id rm3mr16561247pbc.188.1364209019029; Mon, 25 Mar 2013 03:56:59 -0700 (PDT) Received: from mail-pa0-f52.google.com (mail-pa0-f52.google.com [209.85.220.52]) by mx.google.com with ESMTPS id vr5si13357476pab.150.2013.03.25.03.56.58 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 25 Mar 2013 03:56:59 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.52 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) client-ip=209.85.220.52; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.52 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-pa0-f52.google.com with SMTP id fb1so976559pad.39 for ; Mon, 25 Mar 2013 03:56:58 -0700 (PDT) X-Received: by 10.68.239.194 with SMTP id vu2mr16519525pbc.147.1364209018349; Mon, 25 Mar 2013 03:56:58 -0700 (PDT) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id y1sm13067861pbg.10.2013.03.25.03.56.55 (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 25 Mar 2013 03:56:57 -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, Jonghwa Lee Subject: [PATCH 4/6] drivers/rtc/rtc-max8997.c: Fix incorrect return value on error Date: Mon, 25 Mar 2013 16:15:25 +0530 Message-Id: <1364208327-14207-5-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: ALoCoQmb+zykHFC7qygEZhN3PVkRcmDfolE3eXsWoYBCyva6omTbrX3NYjUtyoVyNaztK/eB6n2W 'ret' was being returned without initializing it to error code. While at it also remove duplicate return statement. Signed-off-by: Sachin Kamat Cc: Jonghwa Lee --- drivers/rtc/rtc-max8997.c | 7 ++----- 1 files changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/rtc/rtc-max8997.c b/drivers/rtc/rtc-max8997.c index d12acc4..5693619 100644 --- a/drivers/rtc/rtc-max8997.c +++ b/drivers/rtc/rtc-max8997.c @@ -491,6 +491,7 @@ static int max8997_rtc_probe(struct platform_device *pdev) virq = irq_create_mapping(max8997->irq_domain, MAX8997_PMICIRQ_RTCA1); if (!virq) { dev_err(&pdev->dev, "Failed to create mapping alarm IRQ\n"); + ret = -ENXIO; goto err_out; } info->virq = virq; @@ -498,13 +499,9 @@ static int max8997_rtc_probe(struct platform_device *pdev) ret = devm_request_threaded_irq(&pdev->dev, virq, NULL, max8997_rtc_alarm_irq, 0, "rtc-alarm0", info); - if (ret < 0) { + if (ret < 0) dev_err(&pdev->dev, "Failed to request alarm IRQ: %d: %d\n", info->virq, ret); - goto err_out; - } - - return ret; err_out: return ret;