forked from Minki/linux
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 <tglx@linutronix.de> Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Reviewed-by: Jason Gunthorpe <jgg@nvidia.com> Acked-by: Vinod Koul <vkoul@kernel.org> Link: https://lore.kernel.org/r/20211210221814.970099984@linutronix.de
This commit is contained in:
parent
f482359001
commit
f6632bb2c1
@ -149,7 +149,7 @@ struct mv_xor_v2_descriptor {
|
|||||||
* @desc_size: HW descriptor size
|
* @desc_size: HW descriptor size
|
||||||
* @npendings: number of pending descriptors (for which tx_submit has
|
* @npendings: number of pending descriptors (for which tx_submit has
|
||||||
* @hw_queue_idx: HW queue index
|
* @hw_queue_idx: HW queue index
|
||||||
* @msi_desc: local interrupt descriptor information
|
* @irq: The Linux interrupt number
|
||||||
* been called, but not yet issue_pending)
|
* been called, but not yet issue_pending)
|
||||||
*/
|
*/
|
||||||
struct mv_xor_v2_device {
|
struct mv_xor_v2_device {
|
||||||
@ -168,7 +168,7 @@ struct mv_xor_v2_device {
|
|||||||
int desc_size;
|
int desc_size;
|
||||||
unsigned int npendings;
|
unsigned int npendings;
|
||||||
unsigned int hw_queue_idx;
|
unsigned int hw_queue_idx;
|
||||||
struct msi_desc *msi_desc;
|
unsigned int irq;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -718,7 +718,6 @@ static int mv_xor_v2_probe(struct platform_device *pdev)
|
|||||||
int i, ret = 0;
|
int i, ret = 0;
|
||||||
struct dma_device *dma_dev;
|
struct dma_device *dma_dev;
|
||||||
struct mv_xor_v2_sw_desc *sw_desc;
|
struct mv_xor_v2_sw_desc *sw_desc;
|
||||||
struct msi_desc *msi_desc;
|
|
||||||
|
|
||||||
BUILD_BUG_ON(sizeof(struct mv_xor_v2_descriptor) !=
|
BUILD_BUG_ON(sizeof(struct mv_xor_v2_descriptor) !=
|
||||||
MV_XOR_V2_EXT_DESC_SIZE);
|
MV_XOR_V2_EXT_DESC_SIZE);
|
||||||
@ -770,14 +769,9 @@ static int mv_xor_v2_probe(struct platform_device *pdev)
|
|||||||
if (ret)
|
if (ret)
|
||||||
goto disable_clk;
|
goto disable_clk;
|
||||||
|
|
||||||
msi_desc = first_msi_entry(&pdev->dev);
|
xor_dev->irq = msi_get_virq(&pdev->dev, 0);
|
||||||
if (!msi_desc) {
|
|
||||||
ret = -ENODEV;
|
|
||||||
goto free_msi_irqs;
|
|
||||||
}
|
|
||||||
xor_dev->msi_desc = msi_desc;
|
|
||||||
|
|
||||||
ret = devm_request_irq(&pdev->dev, msi_desc->irq,
|
ret = devm_request_irq(&pdev->dev, xor_dev->irq,
|
||||||
mv_xor_v2_interrupt_handler, 0,
|
mv_xor_v2_interrupt_handler, 0,
|
||||||
dev_name(&pdev->dev), xor_dev);
|
dev_name(&pdev->dev), xor_dev);
|
||||||
if (ret)
|
if (ret)
|
||||||
@ -892,7 +886,7 @@ static int mv_xor_v2_remove(struct platform_device *pdev)
|
|||||||
xor_dev->desc_size * MV_XOR_V2_DESC_NUM,
|
xor_dev->desc_size * MV_XOR_V2_DESC_NUM,
|
||||||
xor_dev->hw_desq_virt, xor_dev->hw_desq);
|
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);
|
platform_msi_domain_free_irqs(&pdev->dev);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user