Re: [PATCH net-next 2/3] net: dec: tulip: de2104x: Replace pci_enable_device with devres version

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

 



On Sun, Sep 13, 2020 at 05:10:01PM -0700, Moritz Fischer wrote:
> Replace pci_enable_device() with its devres counterpart
> pcim_enable_device().
> 
> Signed-off-by: Moritz Fischer <mdf@xxxxxxxxxx>
> ---
>  drivers/net/ethernet/dec/tulip/de2104x.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/net/ethernet/dec/tulip/de2104x.c b/drivers/net/ethernet/dec/tulip/de2104x.c
> index 9bcfc82b71d1..e4189c45c2ba 100644
> --- a/drivers/net/ethernet/dec/tulip/de2104x.c
> +++ b/drivers/net/ethernet/dec/tulip/de2104x.c
> @@ -2009,14 +2009,14 @@ static int de_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
>  	netif_carrier_off(dev);
>  
>  	/* wake up device, assign resources */
> -	rc = pci_enable_device(pdev);
> +	rc = pcim_enable_device(pdev);
>  	if (rc)
>  		return rc;
>  
>  	/* reserve PCI resources to ensure driver atomicity */
>  	rc = pci_request_regions(pdev, DRV_NAME);
>  	if (rc)
> -		goto err_out_disable;
> +		return rc;
>  
>  	/* check for invalid IRQ value */
>  	if (pdev->irq < 2) {
> @@ -2096,8 +2096,6 @@ static int de_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
>  	iounmap(regs);
>  err_out_res:
>  	pci_release_regions(pdev);
> -err_out_disable:
> -	pci_disable_device(pdev);
>  	return rc;
>  }
>  
> @@ -2111,7 +2109,6 @@ static void de_remove_one(struct pci_dev *pdev)
>  	kfree(de->ee_data);
>  	iounmap(de->regs);
>  	pci_release_regions(pdev);
> -	pci_disable_device(pdev);
>  }
>  
>  #ifdef CONFIG_PM
> -- 
> 2.28.0
> 

Ugh, sorry for the noise, I missed the instances in the suspend/resume.
Let me resend a v2 of this ...

Thanks,
Moritz



[Index of Archives]     [Linux SoC]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux