Re: [PATCH v3 5/5] misc: pci_endpoint_test: Do not use managed irq functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Feb 10, 2025 at 04:58:12PM +0900, Kunihiko Hayashi wrote:
> The pci_endpoint_test_request_irq() and pci_endpoint_test_release_irq()
> are called repeatedly by the users through pci_endpoint_test_set_irq().
> So using the managed version of IRQ functions within these functions
> has no effect.
> 
> Suggested-by: Manivannan Sadhasivam <manivannan.sadhasivam@xxxxxxxxxx>
> Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@xxxxxxxxxxxxx>

Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@xxxxxxxxxx>

- Mani

> ---
>  drivers/misc/pci_endpoint_test.c | 9 ++++-----
>  1 file changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/misc/pci_endpoint_test.c b/drivers/misc/pci_endpoint_test.c
> index 8d98cd18634d..9465d2ab259a 100644
> --- a/drivers/misc/pci_endpoint_test.c
> +++ b/drivers/misc/pci_endpoint_test.c
> @@ -212,10 +212,9 @@ static void pci_endpoint_test_release_irq(struct pci_endpoint_test *test)
>  {
>  	int i;
>  	struct pci_dev *pdev = test->pdev;
> -	struct device *dev = &pdev->dev;
>  
>  	for (i = 0; i < test->num_irqs; i++)
> -		devm_free_irq(dev, pci_irq_vector(pdev, i), test);
> +		free_irq(pci_irq_vector(pdev, i), test);
>  
>  	test->num_irqs = 0;
>  }
> @@ -228,9 +227,9 @@ static int pci_endpoint_test_request_irq(struct pci_endpoint_test *test)
>  	struct device *dev = &pdev->dev;
>  
>  	for (i = 0; i < test->num_irqs; i++) {
> -		ret = devm_request_irq(dev, pci_irq_vector(pdev, i),
> -				       pci_endpoint_test_irqhandler,
> -				       IRQF_SHARED, test->name, test);
> +		ret = request_irq(pci_irq_vector(pdev, i),
> +				  pci_endpoint_test_irqhandler, IRQF_SHARED,
> +				  test->name, test);
>  		if (ret)
>  			goto fail;
>  	}
> -- 
> 2.25.1
> 

-- 
மணிவண்ணன் சதாசிவம்




[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux