Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp567799ybi; Wed, 17 Jul 2019 01:22:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqx/DqphSebBKzXr5LlTiINZ1buuGPb43ILlPZvGOy+C1I3PTp/jpUVOEeR/7r18mVwzd3DJ X-Received: by 2002:a17:902:2bcb:: with SMTP id l69mr41869093plb.155.1563351738483; Wed, 17 Jul 2019 01:22:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563351738; cv=none; d=google.com; s=arc-20160816; b=ykbwUj8B8Nms8moHbEoVsqzfn1SDS21rcRcKJTBgYay7/FVKg6BoNrbbKXeDsUEmqR DnkTGEiQR9yC1+oOEuAS/HKqcSRqUm92bpeJ6FnGcJMeWswCzpxUKWianY0zUwd/G1bC 2W2550CjR0J5YFDz/SerbM6itysJ3nY1iZgwjPjwnHv9rn8XEM0HxekAHKBprYtu+rcb SgKfZLQ/l9vMhtVHC1tRXcU2ERs0xr/tjdk6p3JycdYAUq0W03p5cHh6rhAFaW/I9U4D 197HYLb0y96vSeVvebdJ9GFOBueF+VbGkbxc6ggUGVYM2k2+C9j0cpmQOpzGhKD8X+Ai 2wbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=roG7/4z8cazsxB/JIxfmiHZc43FJBHOauOZYRBPPL6k=; b=gGTm40Yc8h8Iy9f7iVAXC9OSPXQGLT5LzIIIZScmrC0znK+xFx9LJyaEvPTAxD6X4P 8PG1EnNyoswmgHBNsIu+NY/Xabu2tLAiY293ugqtHcxhVGk37K0t2oP5yKflPYtNO/YU ihY6LyRvCG70l1IfcZkIugwsjocjByYelQaUc3Y3UjNWvOz1wixwKWjoU5d2U/FG3sA2 jLcK499YRQ1X+krrSUxjFXDj8w/HH8D0ORgYvt17nyMlgLCyeGUBSvGZMKYU7/VxmwQN Szrzf2tJVE/M5aiapFyrgG29fJE64QlK4MtRklzSUNzi+daIRVz5c3HSc/TwDiaDwBxD qQAg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f20si23019121pfn.166.2019.07.17.01.22.02; Wed, 17 Jul 2019 01:22:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727079AbfGQIVf (ORCPT + 99 others); Wed, 17 Jul 2019 04:21:35 -0400 Received: from inva021.nxp.com ([92.121.34.21]:39664 "EHLO inva021.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726188AbfGQIVe (ORCPT ); Wed, 17 Jul 2019 04:21:34 -0400 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 46905200099; Wed, 17 Jul 2019 10:21:33 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 31C9B20024E; Wed, 17 Jul 2019 10:21:30 +0200 (CEST) Received: from titan.ap.freescale.net (TITAN.ap.freescale.net [10.192.208.233]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 041B2402C3; Wed, 17 Jul 2019 16:21:25 +0800 (SGT) From: Anson.Huang@nxp.com To: a.zummo@towertech.it, alexandre.belloni@bootlin.com, linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Linux-imx@nxp.com Subject: [PATCH] rtc: mxc_v2: use devm_platform_ioremap_resource() to simplify code Date: Wed, 17 Jul 2019 16:12:17 +0800 Message-Id: <20190717081217.30518-1-Anson.Huang@nxp.com> X-Mailer: git-send-email 2.9.5 X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Anson Huang Use the new helper devm_platform_ioremap_resource() which wraps the platform_get_resource() and devm_ioremap_resource() together, to simplify the code. Signed-off-by: Anson Huang --- drivers/rtc/rtc-mxc_v2.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/rtc/rtc-mxc_v2.c b/drivers/rtc/rtc-mxc_v2.c index 5b970a8..9153456 100644 --- a/drivers/rtc/rtc-mxc_v2.c +++ b/drivers/rtc/rtc-mxc_v2.c @@ -279,7 +279,6 @@ static int mxc_rtc_wait_for_flag(void __iomem *ioaddr, int flag) static int mxc_rtc_probe(struct platform_device *pdev) { struct mxc_rtc_data *pdata; - struct resource *res; void __iomem *ioaddr; int ret = 0; @@ -287,8 +286,7 @@ static int mxc_rtc_probe(struct platform_device *pdev) if (!pdata) return -ENOMEM; - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - pdata->ioaddr = devm_ioremap_resource(&pdev->dev, res); + pdata->ioaddr = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(pdata->ioaddr)) return PTR_ERR(pdata->ioaddr); -- 2.7.4