From patchwork Wed Jul 5 08:18:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?5p2O5oms6Z+s?= X-Patchwork-Id: 116018 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp1714376vqx; Wed, 5 Jul 2023 01:29:18 -0700 (PDT) X-Google-Smtp-Source: APBJJlEZkWyIbU6zRqWR6xEMGSXlUEdBKGerJvzZlmk1Twe8z5ZYpAB/MNthjJ8ZU9OILYQb/VGg X-Received: by 2002:a05:6a00:984:b0:675:b734:d302 with SMTP id u4-20020a056a00098400b00675b734d302mr15207582pfg.1.1688545757736; Wed, 05 Jul 2023 01:29:17 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1688545757; cv=pass; d=google.com; s=arc-20160816; b=ztHUz4Y/hOUC/6Oitc4il5Wpp/EZaDzdvYc0Nge74SfE1jOCNu/ORnvsMuGMM1qlwE G9gV9/gHytnk7gCaNyrV0d0XX94PeRJ/vWNhStupjziQsRS9NtdvsCp8pnmtATeZfKMF D47N8KMshqCtkTI1bMYN6CwbAFtBQ0hKxl0voIXdsHLWuAARdSOk47dvUv5ouB4Z9qML kFvEMky2MQpWHG5CofqcoxkSCr0wmK2irsbD0X5IwaeqiJUNS031zmrdHfIIzlyis+sO zIBrSHIPvCxHZ0vVPm4jm/LxL87lWdAig7DUKaDf4FKnJKRb1TTubzAGhh266hmuCt65 rb5w== 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=LBtXhkqpY+MAbVIK4ZrXO0TtwYZpnTQ741WVcjdyNWQ=; fh=JLvGLoF9+6BGRt7zvhcm0h0HnlD9TjmuUJXRqPNlUtc=; b=VolPbLjlOqc8rGV9c/f4k7U8eCTu3+3IjCBBf6WN7cIDAAWSYL5vYpJGufqIUIPSlm NgNQIFb8Y3GTm5mYDdpqWxo7woLQ3S/FFFsKY3kO4Bty8dZvDnPU5o9ZfwybostWheU4 yL/hLHWSJQxPMXr4QtgrTCvpaJiBUYVcJex+twfyGedTAAdDmvsmv0+8lUkjuURfZvAU 7Bb8UUz7ziTarSNsO3PpnrIzYa27880CGD5zp4Ibzaxd4bd9bsHXWYEEUcQsiCCsWRw0 yoyYVyfeXlSkAuN0O26elrBOM+Oy6MHkbdBFPVNY7Lx8Yv1+iXRXyYj+iN99AmCuV+5x Yh6Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=CpCZI9QD; 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 ct6-20020a056a000f8600b0067d9a4abc7esi16341435pfb.68.2023.07.05.01.29.04; Wed, 05 Jul 2023 01:29:17 -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=CpCZI9QD; 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 S232437AbjGEIVM (ORCPT + 99 others); Wed, 5 Jul 2023 04:21:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44636 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232400AbjGEIUp (ORCPT ); Wed, 5 Jul 2023 04:20:45 -0400 Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2072a.outbound.protection.outlook.com [IPv6:2a01:111:f403:704b::72a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 887002113; Wed, 5 Jul 2023 01:20:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bK34RRxNYn1XvbPP11Gxu2uy0q8RBMYDZD/RcfJ4RJFsT/xGTiHVgFBpZW9HcbNaAc3wfK5NkqqIk97Ac+6g2KhKfQ7UNi6w/vfQqyIyGDq/o97I2dbQBvxOQnM26Zar+/ohZH/7Y8TPE6XkL31h0pGtkMPpSaHYPyJ+GgzHgcM4ynSZ9poY6FtCjZcaKKWpzRBF8egv1YrqxpZQLHmJl1w44j1kN08dLxhYYaqGyvoQVEloRdlb77IbJmEi1D5dR8L/86T5wI27KNZUKvYLFfydaphCKfHTpG8LTpvW96Gan+/U390qpbfqglMHVncZgh9GGdbATjRWSYrqq0Rf/g== 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=LBtXhkqpY+MAbVIK4ZrXO0TtwYZpnTQ741WVcjdyNWQ=; b=e+Q4PibW/XY5yFHp/o0AqRQFMt89hOIwiRaomoNJOmymX2nqappgsW5WjEWF8LNw4enWXmV9EvuTzejrkA8jORjr6WT1vNkyl4ujJxrV7WyQLPTLmtcXeuSDYuCT1aYxKKJ80WaHHq1rDo6yz0XZWQgXi2IyhAxEoWHsBoE4Oi35+SwbY5VXJJniPXvF78F1ygGxqp/JeHn9i0qZvvF5k1x0H37MNpSS+z6G4QydJD0FJGSTXgHfWSOo1bJtkP80TiPVbsFHs5qUnGZlY9Wh5ZEdoCiwanke8CkIsf06jwrrlKodjv5irXF6bItI4VUcJVidbWSbNWM8zNAHp18X0w== 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=LBtXhkqpY+MAbVIK4ZrXO0TtwYZpnTQ741WVcjdyNWQ=; b=CpCZI9QD5XgTIaaRI/Vnx4PXvc8imor0fnZfM1vxXCC24+LSXxqA3lawRLjuDF8h8e8n4iTo5uH4W5uEda7n/fQIiGkpfklNIhc7rVDREyc7/qCopQy1CkXq4V6yRG/xs7sXJ+x20ZSm2HtKKXbKApBHICyXojbeFP3eiuZU9eyFSCS3L+hEUt/I0vEH4l1mur/fx4AbauJ5mOvYgyhW1NJvLdj52atZbfjHGhEI2mpSJYWGC0zVonzw+e7ykGgULmnVd7EwBdIvYklBvVkjuINhswY/fz0vnLiixmU5rfzsCCoDldBF1LRfh8SpcutSzPhr2YcFh6goIy0SCyykcA== 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 SEZPR06MB5119.apcprd06.prod.outlook.com (2603:1096:101:4e::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Wed, 5 Jul 2023 08:19:14 +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; Wed, 5 Jul 2023 08:19:14 +0000 From: Yangtao Li To: Vinod Koul Cc: Yangtao Li , dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/5] dmaengine: shdmac: Convert to devm_platform_ioremap_resource() Date: Wed, 5 Jul 2023 16:18:55 +0800 Message-Id: <20230705081856.13734-4-frank.li@vivo.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230705081856.13734-1-frank.li@vivo.com> References: <20230705081856.13734-1-frank.li@vivo.com> X-ClientProxiedBy: SG2P153CA0044.APCP153.PROD.OUTLOOK.COM (2603:1096:4:c6::13) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|SEZPR06MB5119:EE_ X-MS-Office365-Filtering-Correlation-Id: 02ff06c5-8f15-42b8-fc1c-08db7d3084ee X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: CYdLAEzUn4NPnqK4E7z1SnUSfwdmKXJuG4ymnfRzlXEXTryc3LLiv9OnB1gUqACGYt5uh1hNr1TrKI2Sw43/tdVCBEnoIUCYjaHJ16j3CmjA67KtfqxKsF958JsyAKbxX2oBMwcUHrtC3HllKMungooWu8t1NGPZeoD12elbelId3u6SBl6PYZV+UeLmHgsN4/pDM/ur3ti5PCqTl342O3cDzxcESmO7olDv0PMNUcgI6Xi1GbvssLA46YsqwLcYzJYaYa86binrW6ho/X0POCx4d05HyWmvEkbFhpQNs4JRPEUjtNcEUNcFkMxfiT73VLE5oPg4AWSSz3L95FAtZeoCbF8IfTOO4hwjSiTvSOL0sNVGFtOFQHPipqUmUM4OT8XSr6FFthHB/XJqRI07eex/vhXA2AdcT7upocX8P5vwr+T6wigF3pavTIdCncw5SOJ4hD5YDNttQAr/zmBqec1kzVGsvfjkk0AE1ZA1e7Ou1ycGpvSTQSDMKBBc12Unta3h6Pwvsxk+XcGIuwurOZan0fwDDYAFLxzT2vKo78iD4KV07BqKAKENaq7eOCfJZbSylsvJ+itYXD5LWxEAp08VrN0K+C7knV83cQnuEPQi02vx/hcC75OYWhjBNqAO 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)(346002)(396003)(366004)(376002)(39860400002)(451199021)(316002)(2616005)(4326008)(6916009)(66556008)(66946007)(83380400001)(8936002)(86362001)(52116002)(1076003)(2906002)(66476007)(5660300002)(8676002)(41300700001)(36756003)(6486002)(6512007)(186003)(6506007)(478600001)(26005)(6666004)(38350700002)(38100700002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: +kIWSsbP1bNDii2d5nuYIWKw2z54ZtkLnK9orJyJQ/MUjQ65jbbJ7xbTegt5X9XMkDZmZpJx3RBitCWWMY3qqMLOAeMI6SnwiIJu+6JfaPg8mfLgLfk6IMfQITmJzvCH9O72YiBZGa6uMUKVpmYyISssJN1xpB8gUCB8zCSVDxyUgEMRqtLoNCZHdMwm2zXC+oNhWZIXs/LyqRnEI8G5QFl048kB0cVsh1ErFm4+ZLvcUfJMKcjxY6BYJgkNfcbZiC+uh2i4YHmPnaJwinhV1pPywYgUIYKfxxCTuXQM8G2zkcGw0w6uvstG4oTsP5giqLBw2W/bk0/m+EjnhZ/ImXrhY16Bx0e8jukj1yP+sGd5nQB5+r3VRiK+ho3SB8qkPZCkhp12eywb3h5F6zFpYPXeAdkSMewa7Nd6vU21cW4yZdUH1WVKynCA7vzQlokBMYAkbD3z3pulBwEwEyffxl1Fl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HpvbnrKhyxroi7zVvFUgsOH7tkD0eXKOg337fj1Aeq X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 02ff06c5-8f15-42b8-fc1c-08db7d3084ee X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2023 08:19:14.6560 (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: WITXp311hdLcxW4+0t/1J3aN2WflQjUI9/jV6YOtGz6A/vCZVbFE3D7QnCptIlCinj4MMIt9Cmk4OyO45SsMHw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEZPR06MB5119 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770568556804002437?= X-GMAIL-MSGID: =?utf-8?q?1770568556804002437?= Use devm_platform_ioremap_resource() to simplify code. Signed-off-by: Yangtao Li --- drivers/dma/sh/shdmac.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/dma/sh/shdmac.c b/drivers/dma/sh/shdmac.c index 5aafe548ca5f..fb3c56a416d1 100644 --- a/drivers/dma/sh/shdmac.c +++ b/drivers/dma/sh/shdmac.c @@ -678,7 +678,7 @@ static int sh_dmae_probe(struct platform_device *pdev) int err, errirq, i, irq_cnt = 0, irqres = 0, irq_cap = 0; struct sh_dmae_device *shdev; struct dma_device *dma_dev; - struct resource *chan, *dmars, *errirq_res, *chanirq_res; + struct resource *dmars, *errirq_res, *chanirq_res; if (pdev->dev.of_node) pdata = of_device_get_match_data(&pdev->dev); @@ -689,7 +689,6 @@ static int sh_dmae_probe(struct platform_device *pdev) if (!pdata || !pdata->channel_num) return -ENODEV; - chan = platform_get_resource(pdev, IORESOURCE_MEM, 0); /* DMARS area is optional */ dmars = platform_get_resource(pdev, IORESOURCE_MEM, 1); /* @@ -709,7 +708,7 @@ static int sh_dmae_probe(struct platform_device *pdev) * requested with the IRQF_SHARED flag */ errirq_res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); - if (!chan || !errirq_res) + if (!errirq_res) return -ENODEV; shdev = devm_kzalloc(&pdev->dev, sizeof(struct sh_dmae_device), @@ -719,7 +718,7 @@ static int sh_dmae_probe(struct platform_device *pdev) dma_dev = &shdev->shdma_dev.dma_dev; - shdev->chan_reg = devm_ioremap_resource(&pdev->dev, chan); + shdev->chan_reg = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(shdev->chan_reg)) return PTR_ERR(shdev->chan_reg); if (dmars) {