Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp286285pxb; Wed, 8 Sep 2021 00:50:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzbZ6Bvt/SqqWiD+wD+EfhdQeH0VAh6E9HfJMbWWNvBd1dqHvaXsJuYt+mlw2F5z7o00aZU X-Received: by 2002:a92:870f:: with SMTP id m15mr1796575ild.2.1631087456130; Wed, 08 Sep 2021 00:50:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631087456; cv=none; d=google.com; s=arc-20160816; b=urvs27qXaLu/Uxuz0JFnkkXZo2DeeXULDegDLa9z5a6O1KdnWB+rXLXg8PuMFH7+v7 wXksYzoDims2pJimix6jaz7wUZk0n+XaoCqUKwMpUd5fm70XMrmgzR/td1sa1ypaO2bn 9ye2xmnXK3+b2KnYRE0eSK9FCuV6TY4bLonKvYuRuR4GEYqrx6QXMSp9nqA8hqQ/x0h2 Up5naxhcII36l4kM/DJWieALiGdW+cNiICknwrhk8c/uWJJK9UBpw5rfQ3SbpDogyNFs SzXU80aNEULWTQl4FPCdeiXrP0oXyBKnlIbhYf4PHm59aNlnlqvCSDLbI09ghDIiO6o6 x4zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=732IZ/Z6Gh1N458lGFBC/DxM+4t9yGFcnKv7QTo855o=; b=EOEB+UXjmqgigD+ifajRCKtHSexQrCObBCtqnMy6DmvlQU/MHYFTVg+zsVNyLx3+eJ qvfFv1KUu8gorahix9qb2C6Tlc6DaG0nQUJ3iv0pmGfA6flDLSHTEgvHvqik5zwULGov 64eEJ5qS8vFgIXLbcuHYLs+lsZThmRzS0DMKdeb0/6oYens5MtuOLmCV4xvZJPY4MI4r CJMKqjK2g1tVu6zbUeLwNlLFIlwBl3HJLJLDcLK0iXTDARsD/Epb1bFN+dGsx9nZY/Ct 87Ze+n+kqxlNQi6xGdxPQqBUuCpnlIpGEeLzzY3liQEqnNXp44GeWa9FXNAZ96w6otMZ ZUDA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q128si1551440ioq.111.2021.09.08.00.50.44; Wed, 08 Sep 2021 00:50:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234575AbhIHHQa (ORCPT + 99 others); Wed, 8 Sep 2021 03:16:30 -0400 Received: from mx20.baidu.com ([111.202.115.85]:33482 "EHLO baidu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S233764AbhIHHQ3 (ORCPT ); Wed, 8 Sep 2021 03:16:29 -0400 Received: from BC-Mail-Ex19.internal.baidu.com (unknown [172.31.51.13]) by Forcepoint Email with ESMTPS id 4CEA44D27B4514C9CA82; Wed, 8 Sep 2021 15:15:20 +0800 (CST) Received: from BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) by BC-Mail-Ex19.internal.baidu.com (172.31.51.13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2242.12; Wed, 8 Sep 2021 15:15:20 +0800 Received: from LAPTOP-UKSR4ENP.internal.baidu.com (172.31.63.8) by BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Wed, 8 Sep 2021 15:15:19 +0800 From: Cai Huoqing To: CC: Matthias Brugger , , , Subject: [PATCH 1/3] soc: mediatek: pwrap: Make use of the helper function devm_platform_ioremap_resource_byname() Date: Wed, 8 Sep 2021 15:15:12 +0800 Message-ID: <20210908071512.551-1-caihuoqing@baidu.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.31.63.8] X-ClientProxiedBy: BJHW-Mail-Ex11.internal.baidu.com (10.127.64.34) To BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use the devm_platform_ioremap_resource_byname() helper instead of calling platform_get_resource_byname() and devm_ioremap_resource() separately Signed-off-by: Cai Huoqing --- drivers/soc/mediatek/mtk-pmic-wrap.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/soc/mediatek/mtk-pmic-wrap.c b/drivers/soc/mediatek/mtk-pmic-wrap.c index 952bc554f443..29f1bd42f7a8 100644 --- a/drivers/soc/mediatek/mtk-pmic-wrap.c +++ b/drivers/soc/mediatek/mtk-pmic-wrap.c @@ -2116,7 +2116,6 @@ static int pwrap_probe(struct platform_device *pdev) struct pmic_wrapper *wrp; struct device_node *np = pdev->dev.of_node; const struct of_device_id *of_slave_id = NULL; - struct resource *res; if (np->child) of_slave_id = of_match_node(of_slave_match_tbl, np->child); @@ -2136,8 +2135,7 @@ static int pwrap_probe(struct platform_device *pdev) wrp->slave = of_slave_id->data; wrp->dev = &pdev->dev; - res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pwrap"); - wrp->base = devm_ioremap_resource(wrp->dev, res); + wrp->base = devm_platform_ioremap_resource_byname(pdev, "pwrap"); if (IS_ERR(wrp->base)) return PTR_ERR(wrp->base); @@ -2151,9 +2149,7 @@ static int pwrap_probe(struct platform_device *pdev) } if (HAS_CAP(wrp->master->caps, PWRAP_CAP_BRIDGE)) { - res = platform_get_resource_byname(pdev, IORESOURCE_MEM, - "pwrap-bridge"); - wrp->bridge_base = devm_ioremap_resource(wrp->dev, res); + wrp->bridge_base = devm_platform_ioremap_resource_byname(pdev, "pwrap-bridge"); if (IS_ERR(wrp->bridge_base)) return PTR_ERR(wrp->bridge_base); -- 2.25.1