diff mbox series

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

Message ID 20200914001002.8623-3-mdf@kernel.org
State New
Headers show
Series None | expand

Commit Message

Moritz Fischer Sept. 14, 2020, 12:10 a.m. UTC
Replace pci_enable_device() with its devres counterpart
pcim_enable_device().

Signed-off-by: Moritz Fischer <mdf@kernel.org>
---
 drivers/net/ethernet/dec/tulip/de2104x.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

Comments

Moritz Fischer Sept. 14, 2020, 3:04 a.m. UTC | #1
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@kernel.org>
> ---
>  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
diff mbox series

Patch

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