From patchwork Wed Jan 25 08:41:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 92407 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp2112077qgi; Wed, 25 Jan 2017 00:56:54 -0800 (PST) X-Received: by 10.200.44.243 with SMTP id 48mr19331067qtx.262.1485334614398; Wed, 25 Jan 2017 00:56:54 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [65.50.211.133]) by mx.google.com with ESMTPS id m29si15032503qki.224.2017.01.25.00.56.54 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Jan 2017 00:56:54 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 65.50.211.133 as permitted sender) client-ip=65.50.211.133; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 65.50.211.133 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cWJNs-0005SV-6M; Wed, 25 Jan 2017 08:56:52 +0000 Received: from szxga02-in.huawei.com ([119.145.14.65]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cWJE6-0008Rr-SI for linux-arm-kernel@lists.infradead.org; Wed, 25 Jan 2017 08:46:52 +0000 Received: from 172.24.1.36 (EHLO szxeml426-hub.china.huawei.com) ([172.24.1.36]) by szxrg02-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id DTT87001; Wed, 25 Jan 2017 16:45:41 +0800 (CST) Received: from linux-ibm.site (10.175.102.37) by szxeml426-hub.china.huawei.com (10.82.67.181) with Microsoft SMTP Server id 14.3.235.1; Wed, 25 Jan 2017 16:45:30 +0800 From: Kefeng Wang To: Hans Ulli Kroll , Alessandro Zummo , Alexandre Belloni , Patrice Chotard , Maxime Ripard , Chen-Yu Tsai , , Subject: [PATCH 4/4] rtc: sunxi: using devm_rtc_device_register helper Date: Wed, 25 Jan 2017 16:41:57 +0800 Message-ID: <1485333717-47536-4-git-send-email-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 1.7.12.4 In-Reply-To: <1485333717-47536-1-git-send-email-wangkefeng.wang@huawei.com> References: <1485333717-47536-1-git-send-email-wangkefeng.wang@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.102.37] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020202.588865B7.02DB, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2013-06-18 04:22:30, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 6046decfe2f36462a2b73981b8598e65 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170125_004647_705694_23C47586 X-CRM114-Status: GOOD ( 12.20 ) X-Spam-Score: -7.4 (-------) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-7.4 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium trust [119.145.14.65 listed in list.dnswl.org] 0.0 T_SPF_HELO_TEMPERROR SPF: test of HELO record failed (temperror) -3.2 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 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: Kefeng Wang Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org Using devm_rtc_device_register() helper to simplify code. Cc: Alessandro Zummo Cc: Alexandre Belloni Cc: Maxime Ripard Cc: Chen-Yu Tsai Signed-off-by: Kefeng Wang --- drivers/rtc/rtc-sunxi.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) -- 1.7.12.4 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel diff --git a/drivers/rtc/rtc-sunxi.c b/drivers/rtc/rtc-sunxi.c index abada60..6fba5ae 100644 --- a/drivers/rtc/rtc-sunxi.c +++ b/drivers/rtc/rtc-sunxi.c @@ -481,8 +481,8 @@ static int sunxi_rtc_probe(struct platform_device *pdev) writel(SUNXI_ALRM_IRQ_STA_CNT_IRQ_PEND, chip->base + SUNXI_ALRM_IRQ_STA); - chip->rtc = rtc_device_register("rtc-sunxi", &pdev->dev, - &sunxi_rtc_ops, THIS_MODULE); + chip->rtc = devm_rtc_device_register(&pdev->dev, "rtc-sunxi", + &sunxi_rtc_ops, THIS_MODULE); if (IS_ERR(chip->rtc)) { dev_err(&pdev->dev, "unable to register device\n"); return PTR_ERR(chip->rtc); @@ -493,18 +493,8 @@ static int sunxi_rtc_probe(struct platform_device *pdev) return 0; } -static int sunxi_rtc_remove(struct platform_device *pdev) -{ - struct sunxi_rtc_dev *chip = platform_get_drvdata(pdev); - - rtc_device_unregister(chip->rtc); - - return 0; -} - static struct platform_driver sunxi_rtc_driver = { .probe = sunxi_rtc_probe, - .remove = sunxi_rtc_remove, .driver = { .name = "sunxi-rtc", .of_match_table = sunxi_rtc_dt_ids,