Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp873844pxb; Wed, 1 Sep 2021 11:49:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyUFGBRusZvtLwoc1CslswgX5gYNYBXsI53k68DO1TNNuIrlBVKwmffNkgvb5AGE898RteE X-Received: by 2002:a6b:e917:: with SMTP id u23mr845807iof.19.1630522182145; Wed, 01 Sep 2021 11:49:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630522182; cv=none; d=google.com; s=arc-20160816; b=XS+1Ks/wI+XBMzKpjXtzp1j0WeScNuvfO+RgqSaT1ElCXRq9IiPTpYnfnbz4JGzabp fhG8VCO8AS/tXXNgdwbvegnxcZHwvlKWIZujPLvit7qUs872c+mkAUtqXHTLrBUMLMoM jShcieDlwgzFhydKg5HAlBE/eDGgSL3yH3L6Acj33hjFd70qxr4/up240pC8zUIX7d0g FYTKn5BSQCYhp9NLizloSPSIeKTRkw4zv69ylTfcva3zCLmeY/OeuZJeQOSjo9XTY4tH 21Az3Otnj8y/kapk0M0/FLWTaUIFwiTOYYtW5hg/kBLoJFEppLTTy36luOMceRUFrEPB 6k/Q== 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=0V/nqLhK4yLakJ4dPQqpImWXkcC48e1H7QpN5dJY/Hc=; b=hyU/G9A68yH0/QX//sPV2kKsHbLCfy3EYYDBR+RuSRoWMIF9IUjdF+KITh3AzPjnEn XTbYZ/VDJwRAHQ1oaQjenu+nan1vGZL5BsD4P5MGfcPElZ1x1+7Lrtik6Y7Yb0I6BRWr D/Z33SazI+xMjFpKzjsqAzPfNuCiwUiNDeSZq+E9dY+3IzuWAJ3v1yLZlJnKJwtjcn1U 64lGPvrV4RvTBJaNp9GFF+gGp2kuTNQV8EoktQQAT0nmtc7n3p5+ZYDstXd0Zz96k+6W 3w5qYXSk1061eV4xvTg1GWJbxm4i1dteet3YQNEjGoD2DwahHZr1fr+Y1ppc3mCvfXfv kvHw== 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 g3si463364ile.29.2021.09.01.11.49.30; Wed, 01 Sep 2021 11:49:42 -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 S242882AbhIAHoV (ORCPT + 99 others); Wed, 1 Sep 2021 03:44:21 -0400 Received: from mx20.baidu.com ([111.202.115.85]:55228 "EHLO baidu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S242886AbhIAHoL (ORCPT ); Wed, 1 Sep 2021 03:44:11 -0400 Received: from BC-Mail-Ex06.internal.baidu.com (unknown [172.31.51.46]) by Forcepoint Email with ESMTPS id A883CDE0611A31EF6C91; Wed, 1 Sep 2021 15:43:13 +0800 (CST) Received: from BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) by BC-Mail-Ex06.internal.baidu.com (172.31.51.46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2242.12; Wed, 1 Sep 2021 15:43:13 +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, 1 Sep 2021 15:43:12 +0800 From: Cai Huoqing To: CC: Vladimir Zapolskiy , Tudor Ambarus , Michael Walle , "Pratyush Yadav" , Miquel Raynal , "Richard Weinberger" , Vignesh Raghavendra , , , Subject: [PATCH] mtd: spi-nor: nxp-spifi: Make use of the helper function devm_platform_ioremap_resource_byname() Date: Wed, 1 Sep 2021 15:43:06 +0800 Message-ID: <20210901074307.9733-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-Ex07.internal.baidu.com (10.127.64.17) 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/mtd/spi-nor/controllers/nxp-spifi.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/mtd/spi-nor/controllers/nxp-spifi.c b/drivers/mtd/spi-nor/controllers/nxp-spifi.c index 2635c80231bb..9032b9ab2eaf 100644 --- a/drivers/mtd/spi-nor/controllers/nxp-spifi.c +++ b/drivers/mtd/spi-nor/controllers/nxp-spifi.c @@ -381,20 +381,17 @@ static int nxp_spifi_probe(struct platform_device *pdev) { struct device_node *flash_np; struct nxp_spifi *spifi; - struct resource *res; int ret; spifi = devm_kzalloc(&pdev->dev, sizeof(*spifi), GFP_KERNEL); if (!spifi) return -ENOMEM; - res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "spifi"); - spifi->io_base = devm_ioremap_resource(&pdev->dev, res); + spifi->io_base = devm_platform_ioremap_resource_byname(pdev, "spifi"); if (IS_ERR(spifi->io_base)) return PTR_ERR(spifi->io_base); - res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "flash"); - spifi->flash_base = devm_ioremap_resource(&pdev->dev, res); + spifi->flash_base = devm_platform_ioremap_resource_byname(pdev, "flash"); if (IS_ERR(spifi->flash_base)) return PTR_ERR(spifi->flash_base); -- 2.25.1