From patchwork Tue Mar 26 04:12:42 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 15643 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 E746C23E64 for ; Tue, 26 Mar 2013 04:24:19 +0000 (UTC) Received: from mail-ve0-f177.google.com (mail-ve0-f177.google.com [209.85.128.177]) by fiordland.canonical.com (Postfix) with ESMTP id A163AA19765 for ; Tue, 26 Mar 2013 04:24:19 +0000 (UTC) Received: by mail-ve0-f177.google.com with SMTP id jw11so1353799veb.8 for ; Mon, 25 Mar 2013 21:24:19 -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=D4s638RCucbuxDB/8JrXQIRx6GnGcHB8r5fmuEqp3ifnjxt5Cp59kKIsNYflOpMlXt Z6xSXWLGUZrHjehaPx5qrVvvBZ4Aja5oAnf0phxaJbSTulyvdQKjxLTAaCc+u/7fV7jy atYOixII4vXB110zyl4gTmEc3ETkolYSqg5bq8aPItsbYGNxCuvfJJEk5f96ndy+sj/y sQ1hi+cVRyv+eaewj/t1ts3ILHEm4N0u3gl/4X64QupNCgyTHj9cb7ZMLGZNrnnvv45O hZ2kEV1YePgPzeXRcTNVHji/z7V/ARjM6yzSTXN3DOMq1fLzWK9O7eY1+iLmxqAZbDIU 1ZCA== X-Received: by 10.58.29.101 with SMTP id j5mr18737533veh.26.1364271859195; Mon, 25 Mar 2013 21:24:19 -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 cg12csp54438ved; Mon, 25 Mar 2013 21:24:18 -0700 (PDT) X-Received: by 10.68.114.229 with SMTP id jj5mr20956549pbb.152.1364271858225; Mon, 25 Mar 2013 21:24:18 -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 zo5si15915128pbc.282.2013.03.25.21.24.17 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 25 Mar 2013 21:24:18 -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 mc8so1181917pbc.0 for ; Mon, 25 Mar 2013 21:24:17 -0700 (PDT) X-Received: by 10.66.196.68 with SMTP id ik4mr21920245pac.105.1364271857867; Mon, 25 Mar 2013 21:24:17 -0700 (PDT) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id mz8sm15894438pbc.9.2013.03.25.21.24.15 (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 25 Mar 2013 21:24:17 -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 5/5] drivers/rtc/rtc-max8907.c: Remove redundant code Date: Tue, 26 Mar 2013 09:42:42 +0530 Message-Id: <1364271162-18141-6-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: ALoCoQmA8BkfrHXb0P6bKOuGNubfVb2hrYabDCXcCyUyVAm7UovrdH3hxXLhBll87nOMiHwkU0+i 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; }