Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751771AbaBGHzT (ORCPT ); Fri, 7 Feb 2014 02:55:19 -0500 Received: from mailout2.samsung.com ([203.254.224.25]:18771 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750743AbaBGHzR (ORCPT ); Fri, 7 Feb 2014 02:55:17 -0500 X-AuditID: cbfee68f-b7f156d00000276c-37-52f49164ea9a From: Jingoo Han To: "'Andrew Morton'" Cc: linux-kernel@vger.kernel.org, "'Alessandro Zummo'" , rtc-linux@googlegroups.com, "'Jingoo Han'" , "'Linus Walleij'" References: <000401cf23d9$d1df6e30$759e4a90$%han@samsung.com> In-reply-to: <000401cf23d9$d1df6e30$759e4a90$%han@samsung.com> Subject: [PATCH 1/4] rtc: rtc-coh901331: Use devm_ioremap_resource() Date: Fri, 07 Feb 2014 16:55:15 +0900 Message-id: <000501cf23d9$f0057a80$d0106f80$%han@samsung.com> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-index: Ac8j2dGo+e7pmAi4QKyN7t2QoeNN8wAAAW2Q Content-language: ko X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrIIsWRmVeSWpSXmKPExsVy+t8zQ92UiV+CDA6sEbRYcvEqu8Wc9WvY LC4vvMRqMeXPciaLy7vmsFns7+xgdGDz2DPxJJvHnWt72DxOzPjN4tG3ZRWjx/R5P5k8Pm+S C2CL4rJJSc3JLEst0rdL4MqYuKqNqeAhd8Xlhd/ZGxifc3YxcnJICJhI7Dx9lA3CFpO4cG89 kM3FISSwjFHi192LbDBFK7Z+ZgKxhQQWMUpcWsMLUfSLUeLrx/9gCTYBNYkvXw6zdzFycIgI 6Eu0tWiA1DAL7GaUWL/2GCtEs63EwpedzCA2p4CdRP+ePrC4sICLROP8jewgNouAqkTrkRmM IDYvUP3MnUuYIGxBiR+T77GA2MwCWhLrdx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iRGcGp5J72Bc1WBxiFGAg1GJh/fE0s9BQqyJZcWVuYcYJTiYlUR4fzZ8CRLiTUms rEotyo8vKs1JLT7EmAz06ERmKdHkfGDayiuJNzQ2MTOyNDKzMDIxNydNWEmc92CrdaCQQHpi SWp2ampBahHMFiYOTqkGRq3iRz/00xk4H7w6X/38UDP/zf2mRuFcm45tjZy7zb05obBH9XOQ QbRiTzw3/69D/nPv9G/RPPuAL49976YVwfPmh3admaiiXlu1dIfOtRDZ9/Vb992R4WXMEdW9 NmH3hmuM9eK655+ZOx+NjYuovFbeHOAtocUf8EB48XHHgmNnkn+Zvlr3TYmlOCPRUIu5qDgR APxM8glRAwAA DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use devm_ioremap_resource() in order to make the code simpler, and remove redundant return value check of platform_get_resource() because the value is checked by devm_ioremap_resource(). Signed-off-by: Jingoo Han --- drivers/rtc/rtc-coh901331.c | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/drivers/rtc/rtc-coh901331.c b/drivers/rtc/rtc-coh901331.c index 73f1575..869cae2 100644 --- a/drivers/rtc/rtc-coh901331.c +++ b/drivers/rtc/rtc-coh901331.c @@ -43,8 +43,6 @@ struct coh901331_port { struct rtc_device *rtc; struct clk *clk; - u32 phybase; - u32 physize; void __iomem *virtbase; int irq; #ifdef CONFIG_PM_SLEEP @@ -173,19 +171,9 @@ static int __init coh901331_probe(struct platform_device *pdev) return -ENOMEM; res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!res) - return -ENOENT; - - rtap->phybase = res->start; - rtap->physize = resource_size(res); - - if (devm_request_mem_region(&pdev->dev, rtap->phybase, rtap->physize, - "rtc-coh901331") == NULL) - return -EBUSY; - - rtap->virtbase = devm_ioremap(&pdev->dev, rtap->phybase, rtap->physize); - if (!rtap->virtbase) - return -ENOMEM; + rtap->virtbase = devm_ioremap_resource(&pdev->dev, res); + if (IS_ERR(rtap->virtbase)) + return PTR_ERR(rtap->virtbase); rtap->irq = platform_get_irq(pdev, 0); if (devm_request_irq(&pdev->dev, rtap->irq, coh901331_interrupt, 0, -- 1.7.10.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/