From patchwork Thu May 8 02:23:36 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 346875 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from mail-ob0-f191.google.com (mail-ob0-f191.google.com [209.85.214.191]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id E8F01140179 for ; Thu, 8 May 2014 12:23:44 +1000 (EST) Received: by mail-ob0-f191.google.com with SMTP id wm4sf430407obc.18 for ; Wed, 07 May 2014 19:23:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20120806; h=mime-version:from:to:subject:date:message-id:x-original-sender :x-original-authentication-results:reply-to:precedence:mailing-list :list-id:list-post:list-help:list-archive:sender:list-subscribe :list-unsubscribe:content-type; bh=MiscNkSUQkQsReZuRJdB8xL1PmopupPL/M07fwvaDt0=; b=wuy5pedRAWtnUlPM4d4QhtkYkk0vvkZC9iBY8zsgShAljPFxr2KLphPUAbBw6KtSO0 7jKoB5Bx8a0rL/qnWVCO++l+jICR4uXyX0d0EO8wpZbiyNCuL27QLbyxZ/Y4kI0v3EqK /D4UhP5sFXJkAFPYXd6sTD53DtkMNTSqlpXsiSyG6cdczsCMMBUWx8WartKFUPGS11lD sGTyz1R5ygAtmRM0uCj7JD1L5BWN2Xjf2xws3TYTFw0OJsdowABkV5EeHzUbtWQ9+HO0 2f+vX1JfbVWAPMKJYFlUbxXeZ1aQOyy+xdF+zhVjxEI+8MRSdKIiFcR8O63r36kDVruh xW4Q== X-Received: by 10.140.94.169 with SMTP id g38mr2061qge.13.1399515821224; Wed, 07 May 2014 19:23:41 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: rtc-linux@googlegroups.com Received: by 10.140.109.200 with SMTP id l66ls3606959qgf.33.gmail; Wed, 07 May 2014 19:23:40 -0700 (PDT) X-Received: by 10.58.111.202 with SMTP id ik10mr458796veb.4.1399515820907; Wed, 07 May 2014 19:23:40 -0700 (PDT) Received: from smtp.gentoo.org (dev.gentoo.org. [2001:470:ea4a:1:214:c2ff:fe64:b2d3]) by gmr-mx.google.com with ESMTPS id nk6si410016pbc.0.2014.05.07.19.23.40 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 May 2014 19:23:40 -0700 (PDT) Received-SPF: pass (google.com: domain of vapier@gentoo.org designates 2001:470:ea4a:1:214:c2ff:fe64:b2d3 as permitted sender) client-ip=2001:470:ea4a:1:214:c2ff:fe64:b2d3; Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id DBEDA33FA9F; Thu, 8 May 2014 02:23:39 +0000 (UTC) From: Mike Frysinger To: rtc-linux@googlegroups.com, Alessandro Zummo Subject: [rtc-linux] [PATCH] rtc-bfin: do not abort when requesting irq fails Date: Wed, 7 May 2014 22:23:36 -0400 Message-Id: <1399515816-14529-1-git-send-email-vapier@gentoo.org> X-Mailer: git-send-email 1.9.2 X-Original-Sender: vapier@gentoo.org X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of vapier@gentoo.org designates 2001:470:ea4a:1:214:c2ff:fe64:b2d3 as permitted sender) smtp.mail=vapier@gentoo.org Reply-To: rtc-linux@googlegroups.com Precedence: list Mailing-list: list rtc-linux@googlegroups.com; contact rtc-linux+owners@googlegroups.com List-ID: X-Google-Group-Id: 712029733259 List-Post: , List-Help: , List-Archive: Sender: rtc-linux@googlegroups.com List-Subscribe: , List-Unsubscribe: , The RTC framework does not let you return an error once a call to devm_rtc_device_register has succeeded. Avoid doing that when the IRQ request fails as we can still support reading/writing the clock without the IRQ. Reported-by: Ales Novak Signed-off-by: Mike Frysinger --- drivers/rtc/rtc-bfin.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/drivers/rtc/rtc-bfin.c b/drivers/rtc/rtc-bfin.c index 0c53f45..fe4bdb0 100644 --- a/drivers/rtc/rtc-bfin.c +++ b/drivers/rtc/rtc-bfin.c @@ -346,7 +346,7 @@ static int bfin_rtc_probe(struct platform_device *pdev) { struct bfin_rtc *rtc; struct device *dev = &pdev->dev; - int ret = 0; + int ret; unsigned long timeout = jiffies + HZ; dev_dbg_stamp(dev); @@ -361,16 +361,17 @@ static int bfin_rtc_probe(struct platform_device *pdev) /* Register our RTC with the RTC framework */ rtc->rtc_dev = devm_rtc_device_register(dev, pdev->name, &bfin_rtc_ops, THIS_MODULE); - if (unlikely(IS_ERR(rtc->rtc_dev))) { - ret = PTR_ERR(rtc->rtc_dev); - goto err; - } + if (unlikely(IS_ERR(rtc->rtc_dev))) + return PTR_ERR(rtc->rtc_dev); /* Grab the IRQ and init the hardware */ ret = devm_request_irq(dev, IRQ_RTC, bfin_rtc_interrupt, 0, pdev->name, dev); if (unlikely(ret)) - goto err; + dev_err(&pdev->dev, + "unable to request IRQ; alarm won't work, " + "and writes will be delayed\n"); + /* sometimes the bootloader touched things, but the write complete was not * enabled, so let's just do a quick timeout here since the IRQ will not fire ... */ @@ -381,9 +382,6 @@ static int bfin_rtc_probe(struct platform_device *pdev) bfin_write_RTC_SWCNT(0); return 0; - -err: - return ret; } static int bfin_rtc_remove(struct platform_device *pdev)