[4/7] spi: spi-nxp-fspi: Convert to devm_platform_ioremap_resource() and devm_platform_ioremap_resource_byname()
Message ID | 20230706032727.9180-4-frank.li@vivo.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2292329vqx; Wed, 5 Jul 2023 20:51:22 -0700 (PDT) X-Google-Smtp-Source: APBJJlGJ84YuNUGOi9BdwyOKWHHYCuDRIcIt6FL3xZhk231GzrqGZ81VXIh5EMuxsRR+CwUVE4Kr X-Received: by 2002:a25:c043:0:b0:c1b:c138:46f4 with SMTP id c64-20020a25c043000000b00c1bc13846f4mr681844ybf.27.1688615481185; Wed, 05 Jul 2023 20:51:21 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1688615481; cv=pass; d=google.com; s=arc-20160816; b=PnjHRzs/RSKOW2pOmVt4VCWODJ/F6VHVAm8Otik9aZvDKZ3JjssPBxvUTtA1WTzesS mruq0cPQmQYPffWqz3oiMcTbsKicq4Tpdl28T3SgFQrL/zDGRVksIw+K3MjGyuZHKLoV /3w4Ncv1pNYYreRJD6kUKh0qFDJRj3ax2mzj4DFeRfqnlHV69zcFSRAsABqdSJUL/Hzs G0qv2oJtqFw11pFA+xUvauNZ80w9FCy4IxIKnZRWLp3YPZCS7q20YLcLftIsqFRVn4q6 o5OZvWqxWeLnXIW9KNhv+odKPobCYtthfEOrNLyiAfu+6JiEPC5LzI0SwhyjPU+Zu1mv S8XQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=J38d30aTpIQfC4mNjrjxXuDl3D9wgHNmq2biXk44o/E=; fh=jfqHFQAcfO/pOCPKnIEH+moiKM2UqNNIFkS+T7XSoxA=; b=r7KtqS1GAibuHYwTD5ygkv1xYcDul4fOvhbUF6aHmcUT4lB0fLzA63DA3bu+gYklqw WpgKhBRvjtEjS6PkR7ig9gB4vuoPxymvnYInsTxJ5v4r4f2drapiR08Qmj+jtTmhksgG TROyPc8Qnx4kC7JbdcYpWeOg67CiJ8GGs37QDPNKD+SgcMqEaXK9gtQFhJNEPaCZt2IW poK4ENgClHL7cVGrJTfw5DHNSLTA0aWUX/yuP+O0gymYrmckj2/LHDWzL9eQjkjtSxjw 5MLPCMAwndqphhAFWxqS0XgNzX3Q7mqjJIY2HeJOclvdMH0QbjP1utK5bovOXsQPxsFc /Wzw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=Wnk7qZDb; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k29-20020a63561d000000b0054fd5511054si540079pgb.447.2023.07.05.20.51.06; Wed, 05 Jul 2023 20:51:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=Wnk7qZDb; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233437AbjGFD14 (ORCPT <rfc822;tebrre53rla2o@gmail.com> + 99 others); Wed, 5 Jul 2023 23:27:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54876 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233339AbjGFD1q (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 5 Jul 2023 23:27:46 -0400 Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2125.outbound.protection.outlook.com [40.107.117.125]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E1241BCA; Wed, 5 Jul 2023 20:27:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OlooU4Ki/UXDtZD4av/p4tezHyzcfajQDPjzzcgQ08uX0tMxs44iz8eIFUIIkt7RpW+M8z6er7P3YJwqJ3AMov4Ap61DpkO8oAEELrShGaZIGRl5bAVR1rXlKFMXyBqIXNQWB3YmtJReAZAPgsish9ZPvQW4ZfMV0/Co2gFNfYwNqoLCS22CA1pQnjNztp54Vx43N59vkUHktoJHTkQJ1EE83ho6siNaJT0FaDAXX4RpRwFm7/QIujWyYEintIvJE6thj1WvPnDf39uE6j8e6TMmwd/gMAcSbC72yTinYdbDS9Zh0DD7nCz/SaiWTMJuqaGblWQJkrCRFDFdIOO8Qw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=J38d30aTpIQfC4mNjrjxXuDl3D9wgHNmq2biXk44o/E=; b=Ud1vNfO2M1tAjoVgMDDiakwnz0RS1ADtwQCLaGJjXVmbT8f4AgDPgEGGM0jiWxxZzBZHDfSldsGB7CAvKlU/3tIRZHOSUWC54n8TS5tT/tD0SAS7tmjJr87IcqBv9rM0Jyqnbc5QkohWE/2Ig4ztm+qE/sSOPY/D68G8m1LG6d3YQT9hB9jb+HMYZyPym1kTHEangSUnMHrKh0eTPWH9WED1IAvgVMpilqEJFOQONCo44bs1unDZppO1cY70MA0p4wDc8EP5DXHawAKT6e6IyDf6ghn7oBwqI6/Kf5u1Zl9vtZ1jBoNq0CPdAax5X6N5FuLPzpNbQcFEykuBk0eVTQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com; dkim=pass header.d=vivo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=J38d30aTpIQfC4mNjrjxXuDl3D9wgHNmq2biXk44o/E=; b=Wnk7qZDb5/OjIySRJUpGwoqwwpYK5jP2IEZMWb6dwlvG2oG7IATpZcqXcmOk+oaZBm3gDoIwZl9RNuR3I+h2UfTiKENewh7Ab4zobVO2KYV4UU9MPyllURBQ64e2YjjRtyGCUOHrR2yMT9D9Cs1jK++aKOdsd3MzBsPkg2lSjGE0QRx+OlP19k/0lLoMIYIIJcZ7YNvNY633e6obM5YVmveSGONJrbpTO7g5R+nb+rHKWgmNOF8l27QyBPj5+WObBhsS+i9Jr+Tnh5Qh7mwwIVPTCpj76up7pCCiWBpBn3L3uYp9zEcxuNjY6aO7f/eD4TgOulNWkL31VHJXZ6MbYQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) by SEYPR06MB5468.apcprd06.prod.outlook.com (2603:1096:101:b5::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Thu, 6 Jul 2023 03:27:42 +0000 Received: from SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::fa0e:6c06:7474:285c]) by SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::fa0e:6c06:7474:285c%5]) with mapi id 15.20.6565.016; Thu, 6 Jul 2023 03:27:42 +0000 From: Yangtao Li <frank.li@vivo.com> To: Han Xu <han.xu@nxp.com>, Haibo Chen <haibo.chen@nxp.com>, Yogesh Gaur <yogeshgaur.83@gmail.com>, Mark Brown <broonie@kernel.org> Cc: Yangtao Li <frank.li@vivo.com>, linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/7] spi: spi-nxp-fspi: Convert to devm_platform_ioremap_resource() and devm_platform_ioremap_resource_byname() Date: Thu, 6 Jul 2023 11:27:23 +0800 Message-Id: <20230706032727.9180-4-frank.li@vivo.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230706032727.9180-1-frank.li@vivo.com> References: <20230706032727.9180-1-frank.li@vivo.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SG2PR04CA0174.apcprd04.prod.outlook.com (2603:1096:4::36) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|SEYPR06MB5468:EE_ X-MS-Office365-Filtering-Correlation-Id: d0be662c-f4ae-4086-0f04-08db7dd0f518 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Z7GC/S39orlfrRdHbUUB/dFtb5njmNqAUI3TxRwp01ULFhKQdGmDuL4y0qp7VATdhaNoMcZbdAWEaaUB4fDSlOxK86ZqwyvvBzLXthsq9YGJ5U0fM1xSwbRs9p1obuJgew3JV2Yd5toP5fwuhr4i8Ayo9BmdLstv/6IJqr9/On2DY4tohqH+ctXpsc6pQISwUrDiv1gBagpCIMDzyHgl0tJ2FRYsMEO7+VnX8P3ppJjhDTwG/QNbRNg9N6BmiIZIxxZqeNQfshbUTaipvUT9GXBgIRHHUz8UPbKTlRiR12DY7ZYjLRifEP5VflsjTscYxxZn2IZPyucx3Rpz1h1E0/+lG0+MXJavYZBGT3f6NiI7Q9iZLiIDwFwh7I0yRfXpiwTpG4CuP36Br6Xvqj8nqkzkoUSdNLgtMmWCPgtryNHhaur3uLyiFoB2K+zyJq3ndt0t7b5nXZF+Kt8g/alVgZT1NXB+NL/seLfBBoy7Ae3j57uQOJURonNdxy34RCC08ILgYool/peMMjdc3N+PW3V0W2UezhJ8HNc+FJ8/KtGj7UHgwm5/pzEBy42/fPPa+Ir8XKw0CNxH6mu6Meuh1req2DwfA/yoxLdp161squQPMeQLaGoPPOYkuAW9V7HC X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SEZPR06MB5269.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(136003)(39860400002)(396003)(376002)(366004)(346002)(451199021)(41300700001)(4744005)(478600001)(6512007)(110136005)(52116002)(86362001)(38100700002)(38350700002)(6666004)(36756003)(6486002)(316002)(66476007)(4326008)(83380400001)(66556008)(66946007)(8676002)(2906002)(8936002)(2616005)(26005)(5660300002)(1076003)(6506007)(186003);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: RNMG3ShvImXYti50aHu+HlcBXeW92x/t2ysommgVDZHaL3IFMFvp9R8OO3RmqqibzceIwqE+VCBUTrtEn/8eRokqkqQ2CvHtaO2Lp8s3RoBvjOykogyboaJNMWgDuaxWs6M4Kle26og7Hev5jsUnEY+TvVWoS2Nd90ewVl2MhLvYG5inkRTCUSsFgopzHuwmwCXo+GsrtABEQxBm/uzMVt8ldqp3shGXo8egpIqQY/Ou0Qb0otwhwl+ORguKGcI844wgKSgYrMI3NJ6o8vbYSOAMop/ZTyMw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kVkbs80ON3UVGGk4K+bRMS/3aTCVD8JJOZC3F8eKuTuSdA0VB7fvYNA1vvumc7uMrY2VYdkNjU9yDFrRR4C6HOxvs1V+qNmcIB/xM1HWBTsnRaxe6AfubOpAJ5A+AzNDZKZfW5fMIa/qsnaSxlGp5mK2uMpB3frp0nhoG0RgUs+iihvrBEqmAOo5c/ZdACsk8xp+KcW5loab1HuLq109y40Gbdy6MaHKIBq9HE/qsL X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: d0be662c-f4ae-4086-0f04-08db7dd0f518 X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2023 03:27:42.3729 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: m+usL/bNQP7QsRnDrrFs/eQ9XMe0GUewJa3GUCIXE2Vrvj5VkQ36ejub4kAMZq2OmTKAagdIgsDLoKKIV36fxw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEYPR06MB5468 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770641666615320479?= X-GMAIL-MSGID: =?utf-8?q?1770641666615320479?= |
Series |
[1/7] spi: atmel: Use devm_platform_get_and_ioremap_resource()
|
|
Commit Message
李扬韬
July 6, 2023, 3:27 a.m. UTC
Use devm_platform_ioremap_resource() and
devm_platform_ioremap_resource_byname() to simplify code.
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
drivers/spi/spi-nxp-fspi.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
Comments
> -----Original Message----- > From: Yangtao Li <frank.li@vivo.com> > Sent: 2023年7月6日 11:27 > To: Han Xu <han.xu@nxp.com>; Bough Chen <haibo.chen@nxp.com>; Yogesh > Gaur <yogeshgaur.83@gmail.com>; Mark Brown <broonie@kernel.org> > Cc: Yangtao Li <frank.li@vivo.com>; linux-spi@vger.kernel.org; > linux-kernel@vger.kernel.org > Subject: [PATCH 4/7] spi: spi-nxp-fspi: Convert to > devm_platform_ioremap_resource() and > devm_platform_ioremap_resource_byname() > > Use devm_platform_ioremap_resource() and > devm_platform_ioremap_resource_byname() to simplify code. Thanks! Reviewed-by: Haibo Chen <haibo.chen@nxp.com> Best Regards Haibo Chen > > Signed-off-by: Yangtao Li <frank.li@vivo.com> > --- > drivers/spi/spi-nxp-fspi.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/drivers/spi/spi-nxp-fspi.c b/drivers/spi/spi-nxp-fspi.c index > 544017655787..4cf9b3bf7b57 100644 > --- a/drivers/spi/spi-nxp-fspi.c > +++ b/drivers/spi/spi-nxp-fspi.c > @@ -1157,12 +1157,10 @@ static int nxp_fspi_probe(struct platform_device > *pdev) > > /* find the resources - configuration register address space */ > if (is_acpi_node(dev_fwnode(f->dev))) > - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); > + f->iobase = devm_platform_ioremap_resource(pdev, 0); > else > - res = platform_get_resource_byname(pdev, > - IORESOURCE_MEM, "fspi_base"); > + f->iobase = devm_platform_ioremap_resource_byname(pdev, > "fspi_base"); > > - f->iobase = devm_ioremap_resource(dev, res); > if (IS_ERR(f->iobase)) { > ret = PTR_ERR(f->iobase); > goto err_put_ctrl; > -- > 2.39.0
diff --git a/drivers/spi/spi-nxp-fspi.c b/drivers/spi/spi-nxp-fspi.c index 544017655787..4cf9b3bf7b57 100644 --- a/drivers/spi/spi-nxp-fspi.c +++ b/drivers/spi/spi-nxp-fspi.c @@ -1157,12 +1157,10 @@ static int nxp_fspi_probe(struct platform_device *pdev) /* find the resources - configuration register address space */ if (is_acpi_node(dev_fwnode(f->dev))) - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); + f->iobase = devm_platform_ioremap_resource(pdev, 0); else - res = platform_get_resource_byname(pdev, - IORESOURCE_MEM, "fspi_base"); + f->iobase = devm_platform_ioremap_resource_byname(pdev, "fspi_base"); - f->iobase = devm_ioremap_resource(dev, res); if (IS_ERR(f->iobase)) { ret = PTR_ERR(f->iobase); goto err_put_ctrl;