Skip to content

Commit f6632bb

Browse files
committed
dmaengine: mv_xor_v2: Get rid of msi_desc abuse
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 <[email protected]> Reviewed-by: Greg Kroah-Hartman <[email protected]> Reviewed-by: Jason Gunthorpe <[email protected]> Acked-by: Vinod Koul <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent f482359 commit f6632bb

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

drivers/dma/mv_xor_v2.c

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ struct mv_xor_v2_descriptor {
149149
* @desc_size: HW descriptor size
150150
* @npendings: number of pending descriptors (for which tx_submit has
151151
* @hw_queue_idx: HW queue index
152-
* @msi_desc: local interrupt descriptor information
152+
* @irq: The Linux interrupt number
153153
* been called, but not yet issue_pending)
154154
*/
155155
struct mv_xor_v2_device {
@@ -168,7 +168,7 @@ struct mv_xor_v2_device {
168168
int desc_size;
169169
unsigned int npendings;
170170
unsigned int hw_queue_idx;
171-
struct msi_desc *msi_desc;
171+
unsigned int irq;
172172
};
173173

174174
/**
@@ -718,7 +718,6 @@ static int mv_xor_v2_probe(struct platform_device *pdev)
718718
int i, ret = 0;
719719
struct dma_device *dma_dev;
720720
struct mv_xor_v2_sw_desc *sw_desc;
721-
struct msi_desc *msi_desc;
722721

723722
BUILD_BUG_ON(sizeof(struct mv_xor_v2_descriptor) !=
724723
MV_XOR_V2_EXT_DESC_SIZE);
@@ -770,14 +769,9 @@ static int mv_xor_v2_probe(struct platform_device *pdev)
770769
if (ret)
771770
goto disable_clk;
772771

773-
msi_desc = first_msi_entry(&pdev->dev);
774-
if (!msi_desc) {
775-
ret = -ENODEV;
776-
goto free_msi_irqs;
777-
}
778-
xor_dev->msi_desc = msi_desc;
772+
xor_dev->irq = msi_get_virq(&pdev->dev, 0);
779773

780-
ret = devm_request_irq(&pdev->dev, msi_desc->irq,
774+
ret = devm_request_irq(&pdev->dev, xor_dev->irq,
781775
mv_xor_v2_interrupt_handler, 0,
782776
dev_name(&pdev->dev), xor_dev);
783777
if (ret)
@@ -892,7 +886,7 @@ static int mv_xor_v2_remove(struct platform_device *pdev)
892886
xor_dev->desc_size * MV_XOR_V2_DESC_NUM,
893887
xor_dev->hw_desq_virt, xor_dev->hw_desq);
894888

895-
devm_free_irq(&pdev->dev, xor_dev->msi_desc->irq, xor_dev);
889+
devm_free_irq(&pdev->dev, xor_dev->irq, xor_dev);
896890

897891
platform_msi_domain_free_irqs(&pdev->dev);
898892

0 commit comments

Comments
 (0)