From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3D869C282E0 for ; Fri, 19 Apr 2019 20:06:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 107B62171F for ; Fri, 19 Apr 2019 20:06:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728231AbfDSUGo (ORCPT ); Fri, 19 Apr 2019 16:06:44 -0400 Received: from mslow2.mail.gandi.net ([217.70.178.242]:56476 "EHLO mslow2.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727427AbfDSUGn (ORCPT ); Fri, 19 Apr 2019 16:06:43 -0400 Received: from relay12.mail.gandi.net (unknown [217.70.178.232]) by mslow2.mail.gandi.net (Postfix) with ESMTP id B045B3A8D47; Fri, 19 Apr 2019 08:00:14 +0000 (UTC) Received: from localhost (alyon-652-1-176-226.w109-212.abo.wanadoo.fr [109.212.207.226]) (Authenticated sender: alexandre.belloni@bootlin.com) by relay12.mail.gandi.net (Postfix) with ESMTPSA id 75C30200011; Fri, 19 Apr 2019 08:00:13 +0000 (UTC) From: Alexandre Belloni To: linux-rtc@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Alexandre Belloni Subject: [PATCH 2/8] rtc: ep93xx: convert to devm_rtc_allocate_device Date: Fri, 19 Apr 2019 09:59:59 +0200 Message-Id: <20190419080005.16138-2-alexandre.belloni@bootlin.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190419080005.16138-1-alexandre.belloni@bootlin.com> References: <20190419080005.16138-1-alexandre.belloni@bootlin.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This allows further improvement of the driver. Signed-off-by: Alexandre Belloni --- drivers/rtc/rtc-ep93xx.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/rtc/rtc-ep93xx.c b/drivers/rtc/rtc-ep93xx.c index db04ac445c69..f15391bc4597 100644 --- a/drivers/rtc/rtc-ep93xx.c +++ b/drivers/rtc/rtc-ep93xx.c @@ -138,11 +138,16 @@ static int ep93xx_rtc_probe(struct platform_device *pdev) platform_set_drvdata(pdev, ep93xx_rtc); - ep93xx_rtc->rtc = devm_rtc_device_register(&pdev->dev, - pdev->name, &ep93xx_rtc_ops, THIS_MODULE); + ep93xx_rtc->rtc = devm_rtc_allocate_device(&pdev->dev); if (IS_ERR(ep93xx_rtc->rtc)) return PTR_ERR(ep93xx_rtc->rtc); + ep93xx_rtc->rtc->ops = &ep93xx_rtc_ops; + + err = rtc_register_device(ep93xx_rtc->rtc); + if (err) + return err; + err = sysfs_create_group(&pdev->dev.kobj, &ep93xx_rtc_sysfs_files); if (err) return err; -- 2.20.1