From patchwork Thu Apr 18 10:00:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Belloni X-Patchwork-Id: 10906933 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A822A161F for ; Thu, 18 Apr 2019 10:01:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8B2FD28C6F for ; Thu, 18 Apr 2019 10:01:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7D8C828C74; Thu, 18 Apr 2019 10:01:13 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED 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 C525D28C6F for ; Thu, 18 Apr 2019 10:01:09 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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:In-Reply-To:References: List-Owner; bh=S82lxU0iQrpkfehJhDWO76psmsgmhqGqyqbPFZWA7uY=; b=qeOfGCOJseXWZJ qWp7SqmnT9FMdjG/bYLgZoK+Ec7Q/h4XVzyG0QGWStyntCqxcJUiBMnkSQVCrFc7DOAPHAcO5TQsT P3HMES+5qSKHuj2xHXE5OBTm8harW1IqQjedDbcQ0Mk4XWXkO1jlBCftWQy4d9MpY3mdhnJMiLvn3 hPoTHFXgI/C3bnIVcGkXVmF7h1LBSI4UyJmj55WvnCzgwCv5s/rRiIwnrbBbifrGVrrGjb4vD5VED ra+AIup4OiXpuG8BxzuyP6XZqvp29LMTV8RGyi044GN+JrjQUHOhxUKhW7lIKODlFko+M9kSqv3kQ U2Qs5Za1Fs/NUYRlZJLA==; 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 1hH3qr-0006sO-I4; Thu, 18 Apr 2019 10:01:05 +0000 Received: from relay1-d.mail.gandi.net ([217.70.183.193]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hH3qm-0006qj-0A for linux-arm-kernel@lists.infradead.org; Thu, 18 Apr 2019 10:01:04 +0000 X-Originating-IP: 109.212.207.226 Received: from localhost (alyon-652-1-176-226.w109-212.abo.wanadoo.fr [109.212.207.226]) (Authenticated sender: alexandre.belloni@bootlin.com) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id 5534A24001B; Thu, 18 Apr 2019 10:00:54 +0000 (UTC) From: Alexandre Belloni To: linux-rtc@vger.kernel.org Subject: [PATCH 1/7] rtc: jz4740: set range Date: Thu, 18 Apr 2019 12:00:39 +0200 Message-Id: <20190418100045.29288-1-alexandre.belloni@bootlin.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190418_030100_194067_D8B849DC X-CRM114-Status: GOOD ( 10.77 ) 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: Paul Cercueil , Mathieu Malaterre , Alexandre Belloni , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org 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 RTC_SEC is a 32-bit seconds counter. Signed-off-by: Alexandre Belloni Tested-by: Mathieu Malaterre --- drivers/rtc/rtc-jz4740.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/rtc/rtc-jz4740.c b/drivers/rtc/rtc-jz4740.c index d0a891777f44..079469627bd7 100644 --- a/drivers/rtc/rtc-jz4740.c +++ b/drivers/rtc/rtc-jz4740.c @@ -348,10 +348,18 @@ static int jz4740_rtc_probe(struct platform_device *pdev) device_init_wakeup(&pdev->dev, 1); - rtc->rtc = devm_rtc_device_register(&pdev->dev, pdev->name, - &jz4740_rtc_ops, THIS_MODULE); + rtc->rtc = devm_rtc_allocate_device(&pdev->dev); if (IS_ERR(rtc->rtc)) { ret = PTR_ERR(rtc->rtc); + dev_err(&pdev->dev, "Failed to allocate rtc device: %d\n", ret); + return ret; + } + + rtc->rtc->ops = &jz4740_rtc_ops; + rtc->rtc->range_max = U32_MAX; + + ret = rtc_register_device(rtc->rtc); + if (ret) { dev_err(&pdev->dev, "Failed to register rtc device: %d\n", ret); return ret; }