From patchwork Mon Mar 25 10:45:27 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 15589 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 BB90023E64 for ; Mon, 25 Mar 2013 10:57:06 +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 83375A192F2 for ; Mon, 25 Mar 2013 10:57:06 +0000 (UTC) Received: by mail-la0-f42.google.com with SMTP id fe20so11093926lab.15 for ; Mon, 25 Mar 2013 03:57:06 -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=7CXtx7seuFpuGNN0IEbmxsBhkvB4lWMOOt7Ye2FASiY=; b=Y4lKe4ZesKiGFrQyQlu2AjPsgEQqLOE/aa2/SFFZ7DsrtVuOTd4jmqr07oUoVY2XUz Vx4aNdCcRPpQ2DnRrrbrV1q/hivtshqfWi+uv52zZauoTcI+k01OJG8tfLSFZj/e6YeE EMnmsGg0yLB2v+Xkn5vuBFEVJ9SAm/TkNjQt4FN0u0IiSBc29kPiqphQ5c9axJLihChu +E3EDG7e6hWvvWXDBgA0gCzEgAB6ITD0meNizi5ln20WpIF5neCvRniqzo3zRqDhxWAk D0vOrJyB7w98zwC6pr/iw2WPUU6yiIucheoUGpF8QZa2j/fHLqAoBHMBHKEMlpIlcPdE ilIw== X-Received: by 10.112.79.1 with SMTP id f1mr5934143lbx.114.1364209026147; Mon, 25 Mar 2013 03:57:06 -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 tg5csp41246lbb; Mon, 25 Mar 2013 03:57:05 -0700 (PDT) X-Received: by 10.68.196.193 with SMTP id io1mr16590688pbc.196.1364209024704; Mon, 25 Mar 2013 03:57:04 -0700 (PDT) Received: from mail-da0-x236.google.com (mail-da0-x236.google.com [2607:f8b0:400e:c00::236]) by mx.google.com with ESMTPS id ol9si12887187pbb.77.2013.03.25.03.57.04 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 25 Mar 2013 03:57:04 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400e:c00::236 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) client-ip=2607:f8b0:400e:c00::236; Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400e:c00::236 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-da0-f54.google.com with SMTP id p1so3161339dad.27 for ; Mon, 25 Mar 2013 03:57:04 -0700 (PDT) X-Received: by 10.69.0.36 with SMTP id av4mr16599531pbd.126.1364209023987; Mon, 25 Mar 2013 03:57:03 -0700 (PDT) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id y1sm13067861pbg.10.2013.03.25.03.57.01 (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 25 Mar 2013 03:57:03 -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 6/6] drivers/rtc/rtc-max8907.c: Remove redundant code Date: Mon, 25 Mar 2013 16:15:27 +0530 Message-Id: <1364208327-14207-7-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: ALoCoQnaLYotu0YQJNKXqX2uPzcVsNqjVxg8Ft6lNSBsiNZX6ty3NXhQNHjzLORnSr/7XV/db672 Remove unnecessary goto statements to simplify the code. devm_request_threaded_irq returns 0 upon success, hence explicit return 0 is not necessary. Signed-off-by: Sachin Kamat --- drivers/rtc/rtc-max8907.c | 13 +++---------- 1 files changed, 3 insertions(+), 10 deletions(-) diff --git a/drivers/rtc/rtc-max8907.c b/drivers/rtc/rtc-max8907.c index 9d62cdb..86afb79 100644 --- a/drivers/rtc/rtc-max8907.c +++ b/drivers/rtc/rtc-max8907.c @@ -200,23 +200,16 @@ static int max8907_rtc_probe(struct platform_device *pdev) rtc->irq = regmap_irq_get_virq(max8907->irqc_rtc, MAX8907_IRQ_RTC_ALARM0); - if (rtc->irq < 0) { - ret = rtc->irq; - goto err_unregister; - } + if (rtc->irq < 0) + return rtc->irq; ret = devm_request_threaded_irq(&pdev->dev, rtc->irq, NULL, max8907_irq_handler, IRQF_ONESHOT, "max8907-alarm0", rtc); - if (ret < 0) { + if (ret < 0) dev_err(&pdev->dev, "Failed to request IRQ%d: %d\n", rtc->irq, ret); - goto err_unregister; - } - - return 0; -err_unregister: return ret; }