Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp384854pxb; Wed, 1 Sep 2021 00:46:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxVx8pNDthbS2w/8/JfLfdgMoUi8lAAOC58dRtD/wwfNd5Et7Fw3wIeoGQJjZ/3HPH1T+yD X-Received: by 2002:a05:6402:895:: with SMTP id e21mr34845241edy.54.1630482367605; Wed, 01 Sep 2021 00:46:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630482367; cv=none; d=google.com; s=arc-20160816; b=QqQbFbMCb+oleY3UUXloMhFepdd29hB6iSMviJ9fyAq0sMR0mcDCwXOty3zAC1Dy7J c+UEVZETVjFw6s1DyFX3P8euzBuJuoVs1JVOrR+yh+ib5RRKFkUb3DyLWF1ZFqsbyKOO RROmKYzotcnXP1GHVV2frKIBEhSiVAOFjKbfmEw71AMSZyemLzYcstjNAQyuYJ2qIS4V MXC/KEZ/VEFcWs3XBYCPcJswbuzow6IrlkUZpAP2ZAMuyqfAXU5h+ujhCpbTIgucrY07 +nwE+ZbiM8vQ/Yx0mtl94DnOdADEmfGa1/u0hw6AUUma6kkS9EoEfyz8WnH17j9UIhEz sd4A== 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=3kcHNx6Yqd+0DSoN9v+Nq2I/ai5dzpyh1uM70S1HjMU=; b=uXleoebCub5m/q8gr3XakE/J4SFwKOCm/ATZ9K8iSPrHjppmneWY/DcB51asyPW9Jq z9CMUBl8G0l8/vS8BBHIwf/W0WKtHQB0EeGbwtm2Kfg0bHdfJ6XWggqYTqzJKMWE7SyJ KgHRN57GOEXxg5kQ5twkAqyyfZERjN9/tvVFRjAGj+722I2NhGgD8jG6yOPN2LgXmLgp uXj4CxIjIR6IMuvOM9zpqX/PM0yg0W9s2dsX50DeXtvSPFnyv6EmcVY7bHt1rG4vQzbp EuPPdT9u8f4ub1dP3YsmQ14HiqGkwmrbnr82CmUSMcgL5DPBDLLT6maRTpTRZ3p4+XxF PfRw== 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 w11si20434625edr.160.2021.09.01.00.45.30; Wed, 01 Sep 2021 00:46:07 -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 S242677AbhIAHlg (ORCPT + 99 others); Wed, 1 Sep 2021 03:41:36 -0400 Received: from mx21.baidu.com ([220.181.3.85]:52210 "EHLO baidu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S242681AbhIAHlf (ORCPT ); Wed, 1 Sep 2021 03:41:35 -0400 Received: from BJHW-Mail-Ex07.internal.baidu.com (unknown [10.127.64.17]) by Forcepoint Email with ESMTPS id 9C92A3482D16142C890C; Wed, 1 Sep 2021 15:40:37 +0800 (CST) Received: from BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) by BJHW-Mail-Ex07.internal.baidu.com (10.127.64.17) 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:40:37 +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:40:36 +0800 From: Cai Huoqing To: CC: Tudor Ambarus , Miquel Raynal , Richard Weinberger , "Vignesh Raghavendra" , Nicolas Ferre , Alexandre Belloni , Ludovic Desroches , , , Subject: [PATCH] mtd: rawnand: atmel: Make use of the helper function devm_platform_ioremap_resource() Date: Wed, 1 Sep 2021 15:40:30 +0800 Message-ID: <20210901074031.8883-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) X-Baidu-BdMsfe-DateCheck: 1_BJHW-Mail-Ex07_2021-09-01 15:40:37:499 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use the devm_platform_ioremap_resource() helper instead of calling platform_get_resource() and devm_ioremap_resource() separately Signed-off-by: Cai Huoqing --- drivers/mtd/nand/raw/atmel/pmecc.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/mtd/nand/raw/atmel/pmecc.c b/drivers/mtd/nand/raw/atmel/pmecc.c index cbb023bf00f7..498e41ccabbd 100644 --- a/drivers/mtd/nand/raw/atmel/pmecc.c +++ b/drivers/mtd/nand/raw/atmel/pmecc.c @@ -834,7 +834,6 @@ static struct atmel_pmecc *atmel_pmecc_create(struct platform_device *pdev, { struct device *dev = &pdev->dev; struct atmel_pmecc *pmecc; - struct resource *res; pmecc = devm_kzalloc(dev, sizeof(*pmecc), GFP_KERNEL); if (!pmecc) @@ -844,13 +843,11 @@ static struct atmel_pmecc *atmel_pmecc_create(struct platform_device *pdev, pmecc->dev = dev; mutex_init(&pmecc->lock); - res = platform_get_resource(pdev, IORESOURCE_MEM, pmecc_res_idx); - pmecc->regs.base = devm_ioremap_resource(dev, res); + pmecc->regs.base = devm_platform_ioremap_resource(pdev, pmecc_res_idx); if (IS_ERR(pmecc->regs.base)) return ERR_CAST(pmecc->regs.base); - res = platform_get_resource(pdev, IORESOURCE_MEM, errloc_res_idx); - pmecc->regs.errloc = devm_ioremap_resource(dev, res); + pmecc->regs.errloc = devm_platform_ioremap_resource(pdev, errloc_res_idx); if (IS_ERR(pmecc->regs.errloc)) return ERR_CAST(pmecc->regs.errloc); -- 2.25.1