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.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham 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 2C646C2BA2B for ; Wed, 15 Apr 2020 20:00:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 06302206F9 for ; Wed, 15 Apr 2020 20:00:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2437461AbgDOUAp (ORCPT ); Wed, 15 Apr 2020 16:00:45 -0400 Received: from relay9-d.mail.gandi.net ([217.70.183.199]:37125 "EHLO relay9-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2436756AbgDOUAo (ORCPT ); Wed, 15 Apr 2020 16:00:44 -0400 X-Originating-IP: 86.202.105.35 Received: from localhost (lfbn-lyo-1-9-35.w86-202.abo.wanadoo.fr [86.202.105.35]) (Authenticated sender: alexandre.belloni@bootlin.com) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id 2B469FF804; Wed, 15 Apr 2020 20:00:42 +0000 (UTC) From: Alexandre Belloni To: linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Alexandre Belloni Subject: [PATCH 2/2] rtc: mt2712: switch to devm_platform_ioremap_resource Date: Wed, 15 Apr 2020 22:00:21 +0200 Message-Id: <20200415200021.157118-2-alexandre.belloni@bootlin.com> X-Mailer: git-send-email 2.25.2 In-Reply-To: <20200415200021.157118-1-alexandre.belloni@bootlin.com> References: <20200415200021.157118-1-alexandre.belloni@bootlin.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-rtc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rtc@vger.kernel.org Using devm_platform_ioremap_resource instead of open coding it reduces the size of the binary. text data bss dec hex filename 3728 216 0 3944 f68 drivers/rtc/rtc-mt2712.o 3744 216 0 3960 f78 drivers/rtc/rtc-mt2712.o.old Signed-off-by: Alexandre Belloni --- Note that while I don't approve the trend of doing this change tree wide, it is way faster to do it myself now and avoid getting the same patch from someone I don't trust (yet). drivers/rtc/rtc-mt2712.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/rtc/rtc-mt2712.c b/drivers/rtc/rtc-mt2712.c index 9868d98f397c..d5f691c8a035 100644 --- a/drivers/rtc/rtc-mt2712.c +++ b/drivers/rtc/rtc-mt2712.c @@ -310,7 +310,6 @@ static const struct rtc_class_ops mt2712_rtc_ops = { static int mt2712_rtc_probe(struct platform_device *pdev) { - struct resource *res; struct mt2712_rtc *mt2712_rtc; int ret; @@ -319,8 +318,7 @@ static int mt2712_rtc_probe(struct platform_device *pdev) if (!mt2712_rtc) return -ENOMEM; - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - mt2712_rtc->base = devm_ioremap_resource(&pdev->dev, res); + mt2712_rtc->base = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(mt2712_rtc->base)) return PTR_ERR(mt2712_rtc->base); -- 2.25.2