From patchwork Sat Nov 27 01:20:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Gleixner X-Patchwork-Id: 12641933 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 59206C433FE for ; Sat, 27 Nov 2021 01:25:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349095AbhK0B21 (ORCPT ); Fri, 26 Nov 2021 20:28:27 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:35546 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345895AbhK0B00 (ORCPT ); Fri, 26 Nov 2021 20:26:26 -0500 Message-ID: <20211126230525.773495940@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1637976056; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: references:references; bh=eogXL9InvhL5Ge9dFq9uLhqM//0IPGCuEWm7SufDzqc=; b=myejIsKx/s4jFvxbjthVHIgoXavIjf+Gu8BIqtwZy6S3rEHed0lIoHCNCqdAxMVBXhvVci vmN+kGdRe+sE9E3ZatpiO5JsOF/PMMXs4jPElmCJC06B1TOjsVbxvEGbYJ7jv+XJxYoyiN ttCwX+1auhr2WBWDF6OvDIdgb0d2N19/D72UiwOSy4yUWIfuLlN+9SO+R/J4n+Hr9wXArS /NurND0itm1tiFe2q/oIF7SI7WjP/mwoc0y6gyh09Hise7nYaddoXvr9X6rzDHCzMFYUt3 ieZAaeBdidhneSXrTYpHQCI/95tA6A8/uKlXHnYAF4FrSwak2G1c2ECC0zgQsA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1637976056; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: references:references; bh=eogXL9InvhL5Ge9dFq9uLhqM//0IPGCuEWm7SufDzqc=; b=ATXrC1SHZ88bPId+XEhx4IACR3McZvO64MyVcdc0+Zzgmo10pbx/qEIh9qqoMo1dMeG7W9 1MX/Q39/iA8FOrDw== From: Thomas Gleixner To: LKML Cc: Bjorn Helgaas , Marc Zygnier , Alex Williamson , Kevin Tian , Jason Gunthorpe , Megha Dey , Ashok Raj , linux-pci@vger.kernel.org, Greg Kroah-Hartman , dmaengine@vger.kernel.org, Vinod Koul , Santosh Shilimkar , iommu@lists.linux-foundation.org, Stuart Yoder , Laurentiu Tudor , Nishanth Menon , Tero Kristo , linux-arm-kernel@lists.infradead.org, x86@kernel.org, Mark Rutland , Will Deacon , Sinan Kaya Subject: [patch 31/37] dmaengine: mv_xor_v2: Get rid of msi_desc abuse References: <20211126224100.303046749@linutronix.de> MIME-Version: 1.0 Date: Sat, 27 Nov 2021 02:20:56 +0100 (CET) Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org Storing a pointer to the MSI descriptor just to keep track of the Linux interrupt number is daft. Use msi_get_virq() instead. Signed-off-by: Thomas Gleixner Cc: dmaengine@vger.kernel.org Cc: Vinod Koul --- drivers/dma/mv_xor_v2.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) --- a/drivers/dma/mv_xor_v2.c +++ b/drivers/dma/mv_xor_v2.c @@ -149,7 +149,7 @@ struct mv_xor_v2_descriptor { * @desc_size: HW descriptor size * @npendings: number of pending descriptors (for which tx_submit has * @hw_queue_idx: HW queue index - * @msi_desc: local interrupt descriptor information + * @irq: The Linux interrupt number * been called, but not yet issue_pending) */ struct mv_xor_v2_device { @@ -168,7 +168,7 @@ struct mv_xor_v2_device { int desc_size; unsigned int npendings; unsigned int hw_queue_idx; - struct msi_desc *msi_desc; + unsigned int irq; }; /** @@ -718,7 +718,6 @@ static int mv_xor_v2_probe(struct platfo int i, ret = 0; struct dma_device *dma_dev; struct mv_xor_v2_sw_desc *sw_desc; - struct msi_desc *msi_desc; BUILD_BUG_ON(sizeof(struct mv_xor_v2_descriptor) != MV_XOR_V2_EXT_DESC_SIZE); @@ -770,14 +769,9 @@ static int mv_xor_v2_probe(struct platfo if (ret) goto disable_clk; - msi_desc = first_msi_entry(&pdev->dev); - if (!msi_desc) { - ret = -ENODEV; - goto free_msi_irqs; - } - xor_dev->msi_desc = msi_desc; + xor_dev->irq = msi_get_virq(&pdev->dev, 0); - ret = devm_request_irq(&pdev->dev, msi_desc->irq, + ret = devm_request_irq(&pdev->dev, xor_dev->irq, mv_xor_v2_interrupt_handler, 0, dev_name(&pdev->dev), xor_dev); if (ret) @@ -892,7 +886,7 @@ static int mv_xor_v2_remove(struct platf xor_dev->desc_size * MV_XOR_V2_DESC_NUM, xor_dev->hw_desq_virt, xor_dev->hw_desq); - devm_free_irq(&pdev->dev, xor_dev->msi_desc->irq, xor_dev); + devm_free_irq(&pdev->dev, xor_dev->irq, xor_dev); platform_msi_domain_free_irqs(&pdev->dev);