From patchwork Wed Jan 25 08:41:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 92403 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp2109532qgi; Wed, 25 Jan 2017 00:47:34 -0800 (PST) X-Received: by 10.200.35.105 with SMTP id b38mr31317832qtb.1.1485334054291; Wed, 25 Jan 2017 00:47:34 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [65.50.211.133]) by mx.google.com with ESMTPS id m3si11155539qkc.39.2017.01.25.00.47.34 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Jan 2017 00:47:34 -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 1cWJEq-0000OS-RU; Wed, 25 Jan 2017 08:47:32 +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 1cWJE7-0008Rs-KF for linux-arm-kernel@lists.infradead.org; Wed, 25 Jan 2017 08:46:57 +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 DTT87003; 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:28 +0800 From: Kefeng Wang To: Hans Ulli Kroll , Alessandro Zummo , Alexandre Belloni , Patrice Chotard , Maxime Ripard , Chen-Yu Tsai , , Subject: [PATCH 2/4] rtc: st-lpc: using devm_rtc_device_register helper Date: Wed, 25 Jan 2017 16:41:55 +0800 Message-ID: <1485333717-47536-2-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.0A020201.588865B6.00F8, 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: 2d611cb9701b445d450d9051eba1dcd9 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170125_004648_054469_62B6CFA6 X-CRM114-Status: GOOD ( 11.53 ) 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: Patrice Chotard Cc: Alessandro Zummo Cc: Alexandre Belloni Signed-off-by: Kefeng Wang --- drivers/rtc/rtc-st-lpc.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 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-st-lpc.c b/drivers/rtc/rtc-st-lpc.c index 74c0a33..4f81124 100644 --- a/drivers/rtc/rtc-st-lpc.c +++ b/drivers/rtc/rtc-st-lpc.c @@ -272,8 +272,8 @@ static int st_rtc_probe(struct platform_device *pdev) st_rtc_set_time(&pdev->dev, &tm_check); } - rtc->rtc_dev = rtc_device_register("st-lpc-rtc", &pdev->dev, - &st_rtc_ops, THIS_MODULE); + rtc->rtc_dev = devm_rtc_device_register(&pdev->dev, "st-lpc-rtc", + &st_rtc_ops, THIS_MODULE); if (IS_ERR(rtc->rtc_dev)) { clk_disable_unprepare(rtc->clk); return PTR_ERR(rtc->rtc_dev); @@ -282,16 +282,6 @@ static int st_rtc_probe(struct platform_device *pdev) return 0; } -static int st_rtc_remove(struct platform_device *pdev) -{ - struct st_rtc *rtc = platform_get_drvdata(pdev); - - if (likely(rtc->rtc_dev)) - rtc_device_unregister(rtc->rtc_dev); - - return 0; -} - #ifdef CONFIG_PM_SLEEP static int st_rtc_suspend(struct device *dev) { @@ -344,7 +334,6 @@ static int st_rtc_resume(struct device *dev) .of_match_table = st_rtc_match, }, .probe = st_rtc_probe, - .remove = st_rtc_remove, }; module_platform_driver(st_rtc_platform_driver);