Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp116704pxb; Wed, 1 Sep 2021 23:40:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwgUKA8EXQn+10QRFp1hbojMRY+MBWxjc3RELwdJMSJURybm4XpuVMUAiWXqmGYQIPnHggF X-Received: by 2002:a17:906:5e4b:: with SMTP id b11mr2079019eju.472.1630564838436; Wed, 01 Sep 2021 23:40:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630564838; cv=none; d=google.com; s=arc-20160816; b=kXwJQKr0KtP27wivtpAxkNvq6XiJLOdrIW3GbK2vamcAS6QjeJfnhzCCC2p8yj/VH3 zGm8tCTaeKdgjJn6C28TB3OI0qSuTNR4BoAw/F+YWidLaM5RwvuIP0z2lGVPyRJ8VfTg sOqeGxiExl/PBJfhImJTxqL/+a+WuapbXB4/c+AcYxmJmnTTdoZyOhBRq9roD7jtuQ2O 65HDdKAk362iP3QnRmfahDGIS0e3MypSXTZ6DuVu2yWF26kngbfUlwr+Xc7KKh5kd4xo bHB1l7kzQi9aRpSHFcyHQoE1dk9P9yU2fGJsZJpvRk8FJMI3aYvZM7bOZIud/1QungEy 2R7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=XR5YI0S4oZb+doWhhPi6iDPgmFHWmTlKTEzkvIyapR0=; b=Zg+BahFujUr9zDhuPX3qD9jDJ+vXnGdbkCZMnCf9X6beeutaj6it9xrrt5SGuWkhKF BsppKQKCCKdN5dLvgViv5CJvku2w/PUXc8ajNB+NU9VY+pkTyAviaWKrFbvVGF694iVW PwPL31qSKWeMvEi/xdZyJJea+rM6giCkLU8Ct3/JzJfYKhJPVNn5TRgWtFd0OB5NtFbp 1I/NtTXJPjrHBRsuMHT+5/TTH9DjbAOJGhoa2vsqKAU/ZbIgJW6XiTLeE8idzxU2SqG6 vyLS2H3SauZiJjUUiq7b1P14VgnZQlbmaV6pJaGj/wN1Z47lin7tQtXmiIcrgFYX006n vuNA== 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 w10si1196978ejv.170.2021.09.01.23.40.03; Wed, 01 Sep 2021 23:40:38 -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 S242135AbhIBGiO (ORCPT + 99 others); Thu, 2 Sep 2021 02:38:14 -0400 Received: from mx21.baidu.com ([220.181.3.85]:35996 "EHLO baidu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S241743AbhIBGiM (ORCPT ); Thu, 2 Sep 2021 02:38:12 -0400 Received: from BJHW-Mail-Ex08.internal.baidu.com (unknown [10.127.64.18]) by Forcepoint Email with ESMTPS id 2702A7305C619AF5E1D2; Thu, 2 Sep 2021 14:37:12 +0800 (CST) Received: from BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) by BJHW-Mail-Ex08.internal.baidu.com (10.127.64.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Thu, 2 Sep 2021 14:37:12 +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; Thu, 2 Sep 2021 14:37:11 +0800 From: Cai Huoqing To: , , , , , , , , , , CC: , , , , , Cai Huoqing Subject: [PATCH v2 3/3] PCI: mediatek-gen3: Make use of the helper function devm_platform_get_and_ioremap_resource_byname() Date: Thu, 2 Sep 2021 14:37:02 +0800 Message-ID: <20210902063702.32066-4-caihuoqing@baidu.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210902063702.32066-1-caihuoqing@baidu.com> References: <20210902063702.32066-1-caihuoqing@baidu.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.31.63.8] X-ClientProxiedBy: BC-Mail-Ex28.internal.baidu.com (172.31.51.22) To BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) X-Baidu-BdMsfe-DateCheck: 1_BJHW-Mail-Ex08_2021-09-02 14:37:12:149 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use the devm_platform_get_and_ioremap_resource_byname() helper instead of calling platform_get_resource_byname() and devm_ioremap_resource() separately. Signed-off-by: Cai Huoqing --- v1->v2: Use devm_platform_get_and_ioremap_resource_byname() instead of devm_platform_ioremap_resource_byname(). drivers/pci/controller/pcie-mediatek-gen3.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/pci/controller/pcie-mediatek-gen3.c b/drivers/pci/controller/pcie-mediatek-gen3.c index 17c59b0d6978..27009da62ec1 100644 --- a/drivers/pci/controller/pcie-mediatek-gen3.c +++ b/drivers/pci/controller/pcie-mediatek-gen3.c @@ -715,10 +715,7 @@ static int mtk_pcie_parse_port(struct mtk_pcie_port *port) struct resource *regs; int ret; - regs = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pcie-mac"); - if (!regs) - return -EINVAL; - port->base = devm_ioremap_resource(dev, regs); + port->base = devm_platform_get_and_ioremap_resource_byname(pdev, "pcie-mac", ®s); if (IS_ERR(port->base)) { dev_err(dev, "failed to map register base\n"); return PTR_ERR(port->base); -- 2.25.1