From patchwork Mon Jul 10 13:38:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yangtao Li X-Patchwork-Id: 13307148 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6697BEB64D9 for ; Mon, 10 Jul 2023 13:40:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232444AbjGJNiy (ORCPT ); Mon, 10 Jul 2023 09:38:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47932 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232383AbjGJNix (ORCPT ); Mon, 10 Jul 2023 09:38:53 -0400 Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on20717.outbound.protection.outlook.com [IPv6:2a01:111:f403:704b::717]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8BE75BC; Mon, 10 Jul 2023 06:38:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ih6I+pzi0JFAep1lG8NQA/09YIwaO7LlxFG40ZMQxSMIi1wNX2BEtabCJJc5mf2qNq816dXlzKOXfZ1MJykLT+iKs+zvmdAPgp5MatBmLr8JIZM9xXc7B2KapbLCmnlTk86DJYJsCQyVIDeS4vr9RkJ53hXe9pDtGyiw2hvjog6hutiT9+bfH807fYW2XtL+oNdMckPHH4Oe6zEWnxk/onVbwNkWR8KGFjRJF5cEBWoy+V04owNJA1w8HKOqhNYF4o8EbyQUaszWptiihtWsNYaZehWGvvO6Rptg9yZrHSXIvAAfF0nU8Tltq1B402W5E4CM8L5+uCVbn8qMGOQYug== 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=OrleoFqRlrlpkA9zftySIVdwKeZrEz4wBhsA2wmpXgs=; b=KvG7tbk731hOHhCLTsIbqWjnaO1ExgeTfs1KYzh4BTPqUs54SyZuyKtKegccnJDCoS7qiOqdHsbLYdnHe8+W00EIms2gRieGvQhX6yRFTDgupSnvwTPKfh0Rn0AJx0892Z5RDqS0vn+8oMLSGsz+iCpxK8zcz5XzGIAmUZWHsLQDAdyCpVQLYBWRqQLbQrBnJu7PcRXEwl7wsN9affQbOi1EhkEKgDmPo3z6w6q4krAAhIU0UjXceW55oPg2BI89OhtrvSgTXJxf5+EMkMYlmOtjrrmpuIxjrh7uWjW/fXEVHWPNQPyoFZ2E3N8KX7eHeMr3LYe62E4EAal4Db6NVA== 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=OrleoFqRlrlpkA9zftySIVdwKeZrEz4wBhsA2wmpXgs=; b=i8RmKwzMc9TPfuyb3hjkqXJrAHC4S6n9NARLgw2bITaVnQNZw14s/4sZ7zU7jDJa/TKzfkea8T264fhba0zj1mf7yZqdOHeuPMEoQHyDFo30qPePaDBH/+Uaz+6B8G5pBn7oWCf4Jxgpsp/R65hQWprbgfcoFqiuI+7v8IGR5Gozfvh4kuaqY2xZpy21XnoUSfipdlDGkw9NRH0RyrgiJlkIV5piGsIjmwPX4gccz/Iz45dKLeflnTdS3Lx7q1c1ydLiGG9d9JtU/ErEPAJeBWJHFHwPKQhhQ6YzqhD1tHs52kEbaESO0Dr4FqvVvks+95e1s/wouQNyfKk7EjFAOA== 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 TY0PR06MB5594.apcprd06.prod.outlook.com (2603:1096:400:32b::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.30; Mon, 10 Jul 2023 13:38:45 +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.028; Mon, 10 Jul 2023 13:38:45 +0000 From: Yangtao Li To: Moritz Fischer , Wu Hao , Xu Yilun , Tom Rix Cc: Yangtao Li , linux-fpga@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 2/3] fpga: socfpga-a10: Convert to devm_platform_ioremap_resource() Date: Mon, 10 Jul 2023 21:38:29 +0800 Message-Id: <20230710133830.65631-2-frank.li@vivo.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230710133830.65631-1-frank.li@vivo.com> References: <20230710133830.65631-1-frank.li@vivo.com> X-ClientProxiedBy: SI1PR02CA0048.apcprd02.prod.outlook.com (2603:1096:4:1f5::11) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|TY0PR06MB5594:EE_ X-MS-Office365-Filtering-Correlation-Id: af66a250-d67f-4bf9-df18-08db814afac2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qlobQLh7qDsU0Xf9GrHBqPjguow2RzrLVTeGJYYZqB48G9fw5L4Ksl25EFxB7NpYwNW/ICLEhTzvmL2029z+4ep/rJ3hkf2OkUTDbiwAaqf9OUnUPUjj7pQxXkRuI6OIwoO2k1Eke6Zoaljm7GbZwO6Lhue7L3DoHz7OP7WRo1mreG5wjusb5s3jpNUtpYsYWNPovIk0wwTG6Edu/l5ADQ1NLjhk8bTgrB2Tl4/zbaaf4Rz/7nwdD8VkjZi79LdtRT3FlJ4GB8+ICEiyBGXQcL4wgBcfWRE9KhSgOjZcv2bqCZ8uD4LcrmoUv9+5A5O2/SpF+v5yUfOIoSddx/uCpZp0gKbmTNrjySlFBl4HbPCAEYsZ/cKY7cbxzecKrAM89w0XD5gmcUfgg7xdfkPP6/diLdpfGO9V5bIA50rcHcY7SpIYAdAUkxdYouFM28YrhOYJUlw2jsxNspMGXyYcE38kYm97cggRC1/ea1DYTUPTwfnipPO8sBNwO4acTY9+5L/RJbzePyxj9SsANB+pOKelqfV/lj8/ARLiOOYd6K9C5Pvlc+2TAXFkCbVViSJ/BfkbzmW6VOyFHITv84STRQMgdzsJOS5fTuM3eKuaw126iKpvkMoqTIpiHBKCNax6 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)(39860400002)(376002)(136003)(346002)(396003)(366004)(451199021)(186003)(26005)(1076003)(6506007)(2616005)(6512007)(83380400001)(41300700001)(4326008)(66476007)(2906002)(66556008)(316002)(5660300002)(8936002)(8676002)(478600001)(66946007)(6486002)(52116002)(6666004)(110136005)(36756003)(38350700002)(38100700002)(86362001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Oq0w6evc7Ug4YSIKKM9P9F1geLvUeUAgE0Ad5NI3DxoMBya7wUol/gFlACL1/yBpzVf2XYkFhqS5U4wwqJeuToQrrTptjBpBnmXe6ndW6zXlAwW0Ev7LebCP8j5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B/mdqC9kT7FyBtT7VPn/FmI+RJOhvVXKUHRcWo6EodjdDbmBaN5ZrsBLgWDK3QIa9+/aPfxUW6sfZcNI9TW4YGREy8hsCGgFG593mT68wCwDuBQSs+vrDIyKM1zXUxn6Rpl46czF4h3/KDkPU65wL/7tPSJ670wc6XEh6mH8YchZQmPTEByftsGK30gWDvNadGH3T1kkYoFfj+AeJWX8OJMePmJHi7522sY5ZfoQ+X7IGt2eRyNm1Am/nQBSVzzvK3jLgSeJJv+Dgismr0J59Ebb5SF8A7bTwRJM4AbAke9VG1BC057mPCR7pACNM3g0dYVHCRXka7n9GJDE/Mn88SlUTtedhfDzHIM4j3GGLnSVU1gTuDMXMpFI/QLat6nPLvQHxnUbn5wfedlGZ X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: af66a250-d67f-4bf9-df18-08db814afac2 X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2023 13:38:43.9769 (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: nTYWvebKy+nMz/I/z5R/nOvhKLxFaMYXNCiAtppChDEZhrRQIWhF/ADWHeF5BNpBfax8+Yw5xPYJQrn+8SCfww== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY0PR06MB5594 Precedence: bulk List-ID: X-Mailing-List: linux-fpga@vger.kernel.org Use devm_platform_ioremap_resource() to simplify code. Signed-off-by: Yangtao Li Acked-by: Xu Yilun --- drivers/fpga/socfpga-a10.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/fpga/socfpga-a10.c b/drivers/fpga/socfpga-a10.c index ac8e89b8a5cc..cc4861e345c9 100644 --- a/drivers/fpga/socfpga-a10.c +++ b/drivers/fpga/socfpga-a10.c @@ -471,7 +471,6 @@ static int socfpga_a10_fpga_probe(struct platform_device *pdev) struct a10_fpga_priv *priv; void __iomem *reg_base; struct fpga_manager *mgr; - struct resource *res; int ret; priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); @@ -479,14 +478,12 @@ static int socfpga_a10_fpga_probe(struct platform_device *pdev) return -ENOMEM; /* First mmio base is for register access */ - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - reg_base = devm_ioremap_resource(dev, res); + reg_base = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(reg_base)) return PTR_ERR(reg_base); /* Second mmio base is for writing FPGA image data */ - res = platform_get_resource(pdev, IORESOURCE_MEM, 1); - priv->fpga_data_addr = devm_ioremap_resource(dev, res); + priv->fpga_data_addr = devm_platform_ioremap_resource(pdev, 1); if (IS_ERR(priv->fpga_data_addr)) return PTR_ERR(priv->fpga_data_addr);