From patchwork Tue Mar 26 04:12:40 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 15641 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 5AB9523E64 for ; Tue, 26 Mar 2013 04:24:14 +0000 (UTC) Received: from mail-vc0-f179.google.com (mail-vc0-f179.google.com [209.85.220.179]) by fiordland.canonical.com (Postfix) with ESMTP id EB36EA19766 for ; Tue, 26 Mar 2013 04:24:13 +0000 (UTC) Received: by mail-vc0-f179.google.com with SMTP id gf12so5360044vcb.10 for ; Mon, 25 Mar 2013 21:24:13 -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=KH/y6AukMDaKk5SEU+0yEAhUS02aLS5tXvdb8l6Di9rsRNy+OZbyBLQH+2iplXef1r hnMgjquJHJo+3u1dUF1HQ8Ok9Cieg51zDeEnBU9iXGHr1PRJfqAe/x4BOqRHwQ9r7Lq2 h02wUg0OqNKZy9d0h8vHexTFv/Bh4UywjOx3mw4xiHYpqSPHdj+/7PsTi8vJ8cKoYskB A8LGWwh5RT+eE7F1ZR+UTCWqQ1HOKxNQjWEL20YosyJBeZuBZ5It0wNjiV+hp7AD1QSe Y8Bwyj5yTx42kSXv4INUiStM3hXg0TU6XA8UA6wxDzUyg7+chQpcNijrN8y7QOkDC6Eq pu4g== X-Received: by 10.58.224.101 with SMTP id rb5mr18834139vec.17.1364271853460; Mon, 25 Mar 2013 21:24:13 -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 cg12csp54430ved; Mon, 25 Mar 2013 21:24:13 -0700 (PDT) X-Received: by 10.68.244.1 with SMTP id xc1mr20692233pbc.165.1364271852615; Mon, 25 Mar 2013 21:24:12 -0700 (PDT) Received: from mail-pb0-f41.google.com (mail-pb0-f41.google.com [209.85.160.41]) by mx.google.com with ESMTPS id dj6si16390720pad.308.2013.03.25.21.24.12 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 25 Mar 2013 21:24:12 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.41 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) client-ip=209.85.160.41; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.160.41 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-f41.google.com with SMTP id mc8so1181883pbc.0 for ; Mon, 25 Mar 2013 21:24:12 -0700 (PDT) X-Received: by 10.66.172.77 with SMTP id ba13mr21726769pac.63.1364271852137; Mon, 25 Mar 2013 21:24:12 -0700 (PDT) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id mz8sm15894438pbc.9.2013.03.25.21.24.09 (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 25 Mar 2013 21:24:11 -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 v2 3/5] drivers/rtc/rtc-max8997.c: Fix incorrect return value on error Date: Tue, 26 Mar 2013 09:42:40 +0530 Message-Id: <1364271162-18141-4-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: ALoCoQm+7RUcWUrlUZhvBXj8c6QhUPmuEw7pGccQcESk2Y1pyUQt35RZHwp8jMrYBJ7+804/80lu '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;