From patchwork Sun May 20 20:27:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Belloni X-Patchwork-Id: 10413595 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C547D601F9 for ; Sun, 20 May 2018 20:28:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B4C6022380 for ; Sun, 20 May 2018 20:28:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A92E426E51; Sun, 20 May 2018 20:28:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 26C3422380 for ; Sun, 20 May 2018 20:28:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=HlbGmv99i3M0cZ1miQc3p/DAvp55JPWcn02EfbvuzNQ=; b=eaqIJZSu2JJA5HIVS6SVsDDgVy TvUiFadtIoTiiCv01qYYwYieu05xUODdGd56/KLuOZa9ND2nB/tNHaRsn3IWXiAJlhrfBCBAHSXcn AQiYi7Z77L2Wh+f1sXhUCJQFp5LSoyjThkvuPV0C4SQo4yXz//gHuqbvFDXycnft6Eyc8yYefcMP4 65OsT5HQo4uzT3EINsDGhPQZ/wPU0GsFabIz4dIulJTpt5Ve/gd4gB4VS0Lx5PaB4Hwj3sZ/VjkGv 0KZdgTPvPjB3Ge70dTVxkGnuulVq6lvOQomfBiMXjQZ+CRDGrUFc9rnoG47wMyGIyLWHPVqUKciz+ g53ThY/Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fKUvo-0000I9-3l; Sun, 20 May 2018 20:27:52 +0000 Received: from mail.bootlin.com ([62.4.15.54]) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fKUvl-00087S-3m for linux-arm-kernel@lists.infradead.org; Sun, 20 May 2018 20:27:50 +0000 Received: by mail.bootlin.com (Postfix, from userid 110) id CCF712078B; Sun, 20 May 2018 22:27:36 +0200 (CEST) Received: from localhost (unknown [88.191.26.124]) by mail.bootlin.com (Postfix) with ESMTPSA id A618F206F6; Sun, 20 May 2018 22:27:36 +0200 (CEST) From: Alexandre Belloni To: linux-rtc@vger.kernel.org Subject: [PATCH 2/2] rtc: brcmstb-waketimer: add range Date: Sun, 20 May 2018 22:27:30 +0200 Message-Id: <20180520202730.28172-2-alexandre.belloni@bootlin.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180520202730.28172-1-alexandre.belloni@bootlin.com> References: <20180520202730.28172-1-alexandre.belloni@bootlin.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180520_132749_297899_50949D6C X-CRM114-Status: GOOD ( 11.63 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexandre Belloni , Florian Fainelli , linux-kernel@vger.kernel.org, bcm-kernel-feedback-list@broadcom.com, Gregory Fong , Brian Norris , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Let the core handle the range. Signed-off-by: Alexandre Belloni Reviewed-by: Florian Fainelli --- drivers/rtc/rtc-brcmstb-waketimer.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/rtc/rtc-brcmstb-waketimer.c b/drivers/rtc/rtc-brcmstb-waketimer.c index ba49d9bcff12..f4010a75f2be 100644 --- a/drivers/rtc/rtc-brcmstb-waketimer.c +++ b/drivers/rtc/rtc-brcmstb-waketimer.c @@ -145,9 +145,6 @@ static int brcmstb_waketmr_settime(struct device *dev, sec = rtc_tm_to_time64(tm); - if (sec > U32_MAX || sec < 0) - return -EINVAL; - writel_relaxed(sec, timer->base + BRCMSTB_WKTMR_COUNTER); return 0; @@ -184,9 +181,6 @@ static int brcmstb_waketmr_setalarm(struct device *dev, else sec = 0; - if (sec > U32_MAX || sec < 0) - return -EINVAL; - brcmstb_waketmr_set_alarm(timer, sec); return 0; @@ -266,6 +260,7 @@ static int brcmstb_waketmr_probe(struct platform_device *pdev) register_reboot_notifier(&timer->reboot_notifier); timer->rtc->ops = &brcmstb_waketmr_ops; + timer->rtc->range_max = U32_MAX; ret = rtc_register_device(timer->rtc); if (ret) {