Skip to content

Commit

Permalink
eni_vdpa: Simplify 'eni_vdpa_probe()'
Browse files Browse the repository at this point in the history
When 'pcim_enable_device()' is used, some resources become automagically
managed.
There is no need to call 'pci_free_irq_vectors()' when the driver is
removed. The same will already be done by 'pcim_release()'.

Signed-off-by: Christophe JAILLET <[email protected]>
Link: https://lore.kernel.org/r/02045bdcbbb25f79bae4827f66029cfcddc90381.1636301587.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Michael S. Tsirkin <[email protected]>
Acked-by: Jason Wang <[email protected]>
  • Loading branch information
tititiou36 authored and mstsirkin committed Jan 14, 2022
1 parent 60af39c commit 10aa250
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions drivers/vdpa/alibaba/eni_vdpa.c
Original file line number Diff line number Diff line change
Expand Up @@ -450,11 +450,6 @@ static u16 eni_vdpa_get_num_queues(struct eni_vdpa *eni_vdpa)
return num;
}

static void eni_vdpa_free_irq_vectors(void *data)
{
pci_free_irq_vectors(data);
}

static int eni_vdpa_probe(struct pci_dev *pdev, const struct pci_device_id *id)
{
struct device *dev = &pdev->dev;
Expand Down Expand Up @@ -488,13 +483,6 @@ static int eni_vdpa_probe(struct pci_dev *pdev, const struct pci_device_id *id)
eni_vdpa->vdpa.dma_dev = &pdev->dev;
eni_vdpa->queues = eni_vdpa_get_num_queues(eni_vdpa);

ret = devm_add_action_or_reset(dev, eni_vdpa_free_irq_vectors, pdev);
if (ret) {
ENI_ERR(pdev,
"failed for adding devres for freeing irq vectors\n");
goto err;
}

eni_vdpa->vring = devm_kcalloc(&pdev->dev, eni_vdpa->queues,
sizeof(*eni_vdpa->vring),
GFP_KERNEL);
Expand Down

0 comments on commit 10aa250

Please sign in to comment.