Skip to contentSkip to conversation

net: ethernet: remove unnecessary pci_set_drvdata()

PATCH Superseded Jingoo Han 9 participants 72 messages Sep 11, 2013 – Sep 17, 2013

Subsystems (37)
lore
Share & tools
lore

Jingoo Han

author
#0 lore raw

cover net: ethernet: remove unnecessary pci_set_drvdata()

Since commit 0998d0631001288a5974afc0b2a5f568bcdecb4d (device-core: Ensure drvdata = NULL when no driver is bound), the driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.

---
 drivers/net/ethernet/3com/typhoon.c                  |    1 -
 drivers/net/ethernet/8390/ne2k-pci.c                 |    3 ---
 drivers/net/ethernet/adaptec/starfire.c              |    2 --
 drivers/net/ethernet/amd/amd8111e.c                  |    2 --
 drivers/net/ethernet/amd/pcnet32.c                   |    1 -
 drivers/net/ethernet/atheros/alx/main.c              |    1 -
 drivers/net/ethernet/broadcom/bnx2.c                 |    3 ---
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c     |    3 ---
 drivers/net/ethernet/broadcom/tg3.c                  |    2 --
 drivers/net/ethernet/brocade/bna/bnad.c              |    1 -
 drivers/net/ethernet/chelsio/cxgb/cxgb2.c            |    2 --
 drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c      |    2 --
 drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c      |    5 ++---
 drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c  |    3 ---
 drivers/net/ethernet/cisco/enic/enic_main.c          |    2 --
 drivers/net/ethernet/dec/tulip/de2104x.c             |    1 -
 drivers/net/ethernet/dec/tulip/dmfe.c                |    3 ---
 drivers/net/ethernet/dec/tulip/tulip_core.c          |    1 -
 drivers/net/ethernet/dec/tulip/uli526x.c             |    2 --
 drivers/net/ethernet/dec/tulip/winbond-840.c         |    3 ---
 drivers/net/ethernet/dec/tulip/xircom_cb.c           |    2 --
 drivers/net/ethernet/dlink/dl2k.c                    |    1 -
 drivers/net/ethernet/dlink/sundance.c                |    2 --
 drivers/net/ethernet/emulex/benet/be_main.c          |    2 --
 drivers/net/ethernet/fealnx.c                        |    4 ++--
 drivers/net/ethernet/icplus/ipg.c                    |    1 -
 drivers/net/ethernet/intel/e100.c                    |    2 --
 drivers/net/ethernet/jme.c                           |    2 --
 drivers/net/ethernet/marvell/skge.c                  |    2 --
 drivers/net/ethernet/marvell/sky2.c                  |    3 ---
 drivers/net/ethernet/micrel/ksz884x.c                |    2 --
 drivers/net/ethernet/myricom/myri10ge/myri10ge.c     |    1 -
 drivers/net/ethernet/natsemi/natsemi.c               |    2 --
 drivers/net/ethernet/neterion/s2io.c                 |    2 --
 drivers/net/ethernet/neterion/vxge/vxge-main.c       |    2 --
 drivers/net/ethernet/packetengines/hamachi.c         |    1 -
 drivers/net/ethernet/packetengines/yellowfin.c       |    2 --
 drivers/net/ethernet/pasemi/pasemi_mac.c             |    1 -
 drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c |    2 --
 drivers/net/ethernet/qlogic/qla3xxx.c                |    2 --
 drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c     |    2 --
 drivers/net/ethernet/qlogic/qlge/qlge_main.c         |    1 -
 drivers/net/ethernet/rdc/r6040.c                     |    2 --
 drivers/net/ethernet/realtek/8139cp.c                |    1 -
 drivers/net/ethernet/realtek/8139too.c               |    1 -
 drivers/net/ethernet/realtek/r8169.c                 |    1 -
 drivers/net/ethernet/sis/sis190.c                    |    1 -
 drivers/net/ethernet/smsc/epic100.c                  |    1 -
 drivers/net/ethernet/smsc/smsc9420.c                 |    2 --
 drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c     |    1 -
 drivers/net/ethernet/sun/cassini.c                   |    2 --
 drivers/net/ethernet/sun/niu.c                       |    2 --
 drivers/net/ethernet/sun/sungem.c                    |    2 --
 drivers/net/ethernet/sun/sunhme.c                    |    2 --
 drivers/net/ethernet/tehuti/tehuti.c                 |    1 -
 drivers/net/ethernet/ti/tlan.c                       |    1 -
 drivers/net/ethernet/toshiba/spider_net.c            |    1 -
 drivers/net/ethernet/toshiba/tc35815.c               |    1 -
 drivers/net/ethernet/via/via-rhine.c                 |    1 -
 59 files changed, 4 insertions(+), 103 deletions(-)
author
#1 lore raw

PATCH 1/52 net: typhoon: remove unnecessary pci_set_drvdata()

The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.

---
 drivers/net/ethernet/3com/typhoon.c |    1 -
 1 file changed, 1 deletion(-)
drivers/net/ethernet/3com/typhoon.c +0 -1
index 144942f6..465cc71 100644
@@ -2525,7 +2525,6 @@ typhoon_remove_one(struct pci_dev *pdev)
 	pci_release_regions(pdev);
 	pci_clear_mwi(pdev);
 	pci_disable_device(pdev);
-	pci_set_drvdata(pdev, NULL);
 	free_netdev(dev);
 }
 
Signature · 1 line
1.7.10.4
maintainer Acked-by on v1 1/52
#2 lore raw

Re: [PATCH 01/52] net: typhoon: remove unnecessary pci_set_drvdata()

Quoted 5 lines · Jingoo Han

The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.

For what it is worth,

author
#3 lore raw

PATCH 2/52 net: 8390: remove unnecessary pci_set_drvdata()

In reply to Jingoo Han

The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.

---
 drivers/net/ethernet/8390/ne2k-pci.c |    3 ---
 1 file changed, 3 deletions(-)
drivers/net/ethernet/8390/ne2k-pci.c +0 -3
index 9220108..fc14a85 100644
@@ -389,9 +389,7 @@ err_out_free_netdev:
 	free_netdev (dev);
 err_out_free_res:
 	release_region (ioaddr, NE_IO_EXTENT);
-	pci_set_drvdata (pdev, NULL);
 	return -ENODEV;
-
 }
 
 /*
@@ -655,7 +653,6 @@ static void ne2k_pci_remove_one(struct pci_dev *pdev)
 	release_region(dev->base_addr, NE_IO_EXTENT);
 	free_netdev(dev);
 	pci_disable_device(pdev);
-	pci_set_drvdata(pdev, NULL);
 }
 
 #ifdef CONFIG_PM
Signature · 1 line
1.7.10.4
author
#4 lore raw

PATCH 3/52 net: starfire: remove unnecessary pci_set_drvdata()

In reply to Jingoo Han

The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.

---
 drivers/net/ethernet/adaptec/starfire.c |    2 --
 1 file changed, 2 deletions(-)
drivers/net/ethernet/adaptec/starfire.c +0 -2
index 8b04bfc..171d73c 100644
@@ -835,7 +835,6 @@ static int starfire_init_one(struct pci_dev *pdev,
 	return 0;
 
 err_out_cleardev:
-	pci_set_drvdata(pdev, NULL);
 	iounmap(base);
 err_out_free_res:
 	pci_release_regions (pdev);
@@ -2012,7 +2011,6 @@ static void starfire_remove_one(struct pci_dev *pdev)
 	iounmap(np->base);
 	pci_release_regions(pdev);
 
-	pci_set_drvdata(pdev, NULL);
 	free_netdev(dev);			/* Will also free np!! */
 }
 
Signature · 1 line
1.7.10.4
author
#5 lore raw

PATCH 4/52 net: pcnet32: remove unnecessary pci_set_drvdata()

In reply to Jingoo Han

The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.

---
 drivers/net/ethernet/amd/pcnet32.c |    1 -
 1 file changed, 1 deletion(-)
drivers/net/ethernet/amd/pcnet32.c +0 -1
index 2d8e288..40b92e3 100644
@@ -2818,7 +2818,6 @@ static void pcnet32_remove_one(struct pci_dev *pdev)
 				    lp->init_block, lp->init_dma_addr);
 		free_netdev(dev);
 		pci_disable_device(pdev);
-		pci_set_drvdata(pdev, NULL);
 	}
 }
 
Signature · 1 line
1.7.10.4
maintainer Acked-by on v1 4/52
#6 lore raw

Re: [PATCH 04/52] net: pcnet32: remove unnecessary pci_set_drvdata()

Quoted 7 lines

Date: Wed, 11 Sep 2013 16:25:09 +0900

The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.

author
#7 lore raw

PATCH 5/52 net: amd8111e: remove unnecessary pci_set_drvdata()

In reply to Jingoo Han

The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.

---
 drivers/net/ethernet/amd/amd8111e.c |    2 --
 1 file changed, 2 deletions(-)
drivers/net/ethernet/amd/amd8111e.c +0 -2
index 1b1429d..d042511 100644
@@ -1711,7 +1711,6 @@ static void amd8111e_remove_one(struct pci_dev *pdev)
 		free_netdev(dev);
 		pci_release_regions(pdev);
 		pci_disable_device(pdev);
-		pci_set_drvdata(pdev, NULL);
 	}
 }
 static void amd8111e_config_ipg(struct net_device* dev)
@@ -1967,7 +1966,6 @@ err_free_reg:
 
 err_disable_pdev:
 	pci_disable_device(pdev);
-	pci_set_drvdata(pdev, NULL);
 	return err;
 
 }
Signature · 1 line
1.7.10.4
author
#8 lore raw

PATCH 6/52 net: alx: remove unnecessary pci_set_drvdata()

In reply to Jingoo Han

The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.

---
 drivers/net/ethernet/atheros/alx/main.c |    1 -
 1 file changed, 1 deletion(-)
drivers/net/ethernet/atheros/alx/main.c +0 -1
index 027398e..73fcd1e 100644
@@ -1372,7 +1372,6 @@ static void alx_remove(struct pci_dev *pdev)
 
 	pci_disable_pcie_error_reporting(pdev);
 	pci_disable_device(pdev);
-	pci_set_drvdata(pdev, NULL);
 
 	free_netdev(alx->dev);
 }
Signature · 1 line
1.7.10.4
author
#9 lore raw

PATCH 7/52 net: bnx2: remove unnecessary pci_set_drvdata()

In reply to Jingoo Han

The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.

---
 drivers/net/ethernet/broadcom/bnx2.c |    3 ---
 1 file changed, 3 deletions(-)
drivers/net/ethernet/broadcom/bnx2.c +0 -3
index e838a3f..ff3f8cc 100644
@@ -8413,7 +8413,6 @@ err_out_release:
 
 err_out_disable:
 	pci_disable_device(pdev);
-	pci_set_drvdata(pdev, NULL);
 
 err_out:
 	return rc;
@@ -8546,7 +8545,6 @@ error:
 	pci_iounmap(pdev, bp->regview);
 	pci_release_regions(pdev);
 	pci_disable_device(pdev);
-	pci_set_drvdata(pdev, NULL);
 err_free:
 	free_netdev(dev);
 	return rc;
@@ -8578,7 +8576,6 @@ bnx2_remove_one(struct pci_dev *pdev)
 
 	pci_release_regions(pdev);
 	pci_disable_device(pdev);
-	pci_set_drvdata(pdev, NULL);
 }
 
 static int
Signature · 1 line
1.7.10.4
author
#10 lore raw

PATCH 8/52 net: bnx2x: remove unnecessary pci_set_drvdata()

In reply to Jingoo Han

The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.

---
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c |    3 ---
 1 file changed, 3 deletions(-)
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +0 -3
index 634a793..40ac8ec 100644
@@ -12267,7 +12267,6 @@ err_out_release:
 
 err_out_disable:
 	pci_disable_device(pdev);
-	pci_set_drvdata(pdev, NULL);
 
 err_out:
 	return rc;
@@ -12831,7 +12830,6 @@ init_one_exit:
 		pci_release_regions(pdev);
 
 	pci_disable_device(pdev);
-	pci_set_drvdata(pdev, NULL);
 
 	return rc;
 }
@@ -12914,7 +12912,6 @@ static void __bnx2x_remove(struct pci_dev *pdev,
 		pci_release_regions(pdev);
 
 	pci_disable_device(pdev);
-	pci_set_drvdata(pdev, NULL);
 }
 
 static void bnx2x_remove_one(struct pci_dev *pdev)
Signature · 1 line
1.7.10.4
author
#11 lore raw

PATCH 9/52 net: tg3: remove unnecessary pci_set_drvdata()

In reply to Jingoo Han

The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.

---
 drivers/net/ethernet/broadcom/tg3.c |    2 --
 1 file changed, 2 deletions(-)
drivers/net/ethernet/broadcom/tg3.c +0 -2
index 5701f3d..29d03e4 100644
@@ -17685,7 +17685,6 @@ err_out_free_res:
 err_out_disable_pdev:
 	if (pci_is_enabled(pdev))
 		pci_disable_device(pdev);
-	pci_set_drvdata(pdev, NULL);
 	return err;
 }
 
@@ -17717,7 +17716,6 @@ static void tg3_remove_one(struct pci_dev *pdev)
 		free_netdev(dev);
 		pci_release_regions(pdev);
 		pci_disable_device(pdev);
-		pci_set_drvdata(pdev, NULL);
 	}
 }
 
Signature · 1 line
1.7.10.4
author
#12 lore raw

PATCH 10/52 net: bna: remove unnecessary pci_set_drvdata()

In reply to Jingoo Han

The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.

---
 drivers/net/ethernet/brocade/bna/bnad.c |    1 -
 1 file changed, 1 deletion(-)
drivers/net/ethernet/brocade/bna/bnad.c +0 -1
index b78e69e..f276433 100644
@@ -3212,7 +3212,6 @@ bnad_init(struct bnad *bnad,
 	bnad->bar0 = ioremap_nocache(bnad->mmio_start, bnad->mmio_len);
 	if (!bnad->bar0) {
 		dev_err(&pdev->dev, "ioremap for bar0 failed\n");
-		pci_set_drvdata(pdev, NULL);
 		return -ENOMEM;
 	}
 	pr_info("bar0 mapped to %p, len %llu\n", bnad->bar0,
Signature · 1 line
1.7.10.4
author
#13 lore raw

PATCH 11/52 net: cxgb4: remove unnecessary pci_set_drvdata()

In reply to Jingoo Han

The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.

---
 drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c +2 -3
index 0d0665c..4e8b13a 100644
@@ -6074,7 +6074,6 @@ sriov:
 	pci_disable_device(pdev);
  out_release_regions:
 	pci_release_regions(pdev);
-	pci_set_drvdata(pdev, NULL);
 	return err;
 }
 
@@ -6122,9 +6121,9 @@ static void remove_one(struct pci_dev *pdev)
 		pci_disable_pcie_error_reporting(pdev);
 		pci_disable_device(pdev);
 		pci_release_regions(pdev);
-		pci_set_drvdata(pdev, NULL);
-	} else
+	} else {
 		pci_release_regions(pdev);
+	}
 }
 
 static struct pci_driver cxgb4_driver = {
Signature · 1 line
1.7.10.4
author
#14 lore raw

PATCH 12/52 net: cxgb3: remove unnecessary pci_set_drvdata()

In reply to Jingoo Han

The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.

---
 drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c |    2 --
 1 file changed, 2 deletions(-)
drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c +0 -2
index b650951..45d7733 100644
@@ -3374,7 +3374,6 @@ out_release_regions:
 	pci_release_regions(pdev);
 out_disable_device:
 	pci_disable_device(pdev);
-	pci_set_drvdata(pdev, NULL);
 out:
 	return err;
 }
@@ -3415,7 +3414,6 @@ static void remove_one(struct pci_dev *pdev)
 		kfree(adapter);
 		pci_release_regions(pdev);
 		pci_disable_device(pdev);
-		pci_set_drvdata(pdev, NULL);
 	}
 }
 
Signature · 1 line
1.7.10.4
author
#15 lore raw

PATCH 13/52 net: cxgb2: remove unnecessary pci_set_drvdata()

In reply to Jingoo Han

The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.

---
 drivers/net/ethernet/chelsio/cxgb/cxgb2.c |    2 --
 1 file changed, 2 deletions(-)
drivers/net/ethernet/chelsio/cxgb/cxgb2.c +0 -2
index d7048db..1d02105 100644
@@ -1168,7 +1168,6 @@ out_free_dev:
 	pci_release_regions(pdev);
 out_disable_pdev:
 	pci_disable_device(pdev);
-	pci_set_drvdata(pdev, NULL);
 	return err;
 }
 
@@ -1347,7 +1346,6 @@ static void remove_one(struct pci_dev *pdev)
 
 	pci_release_regions(pdev);
 	pci_disable_device(pdev);
-	pci_set_drvdata(pdev, NULL);
 	t1_sw_reset(pdev);
 }
 
Signature · 1 line
1.7.10.4
author
#16 lore raw

PATCH 14/52 net: cxgb4vf: remove unnecessary pci_set_drvdata()

In reply to Jingoo Han

The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.

---
 drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c |    3 ---
 1 file changed, 3 deletions(-)
drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c +0 -3
index 40c22e7..43bb012 100644
@@ -2782,11 +2782,9 @@ err_unmap_bar:
 
 err_free_adapter:
 	kfree(adapter);
-	pci_set_drvdata(pdev, NULL);
 
 err_release_regions:
 	pci_release_regions(pdev);
-	pci_set_drvdata(pdev, NULL);
 	pci_clear_master(pdev);
 
 err_disable_device:
@@ -2851,7 +2849,6 @@ static void cxgb4vf_pci_remove(struct pci_dev *pdev)
 		}
 		iounmap(adapter->regs);
 		kfree(adapter);
-		pci_set_drvdata(pdev, NULL);
 	}
 
 	/*
Signature · 1 line
1.7.10.4
#17 lore raw

Re: [PATCH 14/52] net: cxgb4vf: remove unnecessary pci_set_drvdata()

I agree that the redundant pci_set_drvdata(pdev, NULL) in
cxgb4vf_pci_probe() under the err_release_regions: label is unneeded, but don't we need to NULL out the PCI Driver Data under the err_free_adapter: label and also in cxgb4vf_pci_remove()? Or is that handled automatically in the PCI infrastructure code which calls the Device Probe and Remove routines? Mostly I was just being an obsessively clean housewife assuming that we'd want to clean up these references ...

Casey

Quoted 33 lines · Jingoo Han

The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.

---
  drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c |    3 ---
  1 file changed, 3 deletions(-)
drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c +0 -3
index 40c22e7..43bb012 100644
@@ -2782,11 +2782,9 @@ err_unmap_bar:
 
  err_free_adapter:
  	kfree(adapter);
-	pci_set_drvdata(pdev, NULL);
 
  err_release_regions:
  	pci_release_regions(pdev);
-	pci_set_drvdata(pdev, NULL);
  	pci_clear_master(pdev);
 
  err_disable_device:
@@ -2851,7 +2849,6 @@ static void cxgb4vf_pci_remove(struct pci_dev *pdev)
  		}
  		iounmap(adapter->regs);
  		kfree(adapter);
-		pci_set_drvdata(pdev, NULL);
  	}
 
  	/*
author
#18 lore raw

Re: [PATCH 14/52] net: cxgb4vf: remove unnecessary pci_set_drvdata()

Quoted 9 lines · Casey Leedom

I agree that the redundant pci_set_drvdata(pdev, NULL) in
cxgb4vf_pci_probe() under the err_release_regions: label is unneeded, but don't we need to NULL out the PCI Driver Data under the
err_free_adapter: label and also in cxgb4vf_pci_remove()? Or is that handled automatically in the PCI infrastructure code which calls the Device Probe and Remove routines? Mostly I was just being an obsessively clean housewife assuming that we'd want to clean up these references ...

No, 'pci_set_drvdata(pdev, NULL) under err_free_adapter label' is not necessary.

As you know, pci_set_drvdata(pdev, NULL) calls dev_set_drvdata() as below:
pci_set_drvdata(pdev, NULL) is dev_set_drvdata(&pdev->dev, NULL).

./include/linux/pci.h
1504:static inline void pci_set_drvdata(struct pci_dev *pdev, void *data) 1505{
1506 dev_set_drvdata(&pdev->dev, data);
1507}

However, when the driver goes to err_free_adapter label, The following sequence will be done.

    kfree(adapter) -> .... -> return -ENOMEM;

In this case,
when probe() returns error value such as '-ENOMEM', really_probe() of driver core automatically calls 'dev_set_drvdata(dev, NULL)' as below:

./drivers/base/dd.c
303-probe_failed:
304 devres_release_all(dev);
305 driver_sysfs_remove(dev);
306 dev->driver = NULL;
307 dev_set_drvdata(dev, NULL);

Thus, without 'pci_set_drvdata(pdev, NULL) under err_free_adapter label', dev_set_drvdata(dev, NULL) can be called.

I already tested this with other drivers such as e1000e LAN card driver.

Best regards,
Jingoo Han

#19 lore raw

Re: [PATCH 14/52] net: cxgb4vf: remove unnecessary pci_set_drvdata()

Ah, okay. And I presume the same is true of the PCI Remove path. I
wasn't aware of this but if it's the Linux pattern to let the surrounding support code do this work, then go for it.

As I said, I'm something of a Mad Housewife when it comes to cleaning
things up which were allocated/assigned in a particular routine. Basically I program like I drive, practising defensive programming ... :-)

Casey

Quoted 48 lines · Jingoo Han
Quoted 8 lines · Casey Leedom

I agree that the redundant pci_set_drvdata(pdev, NULL) in
cxgb4vf_pci_probe() under the err_release_regions: label is unneeded, but don't we need to NULL out the PCI Driver Data under the
err_free_adapter: label and also in cxgb4vf_pci_remove()? Or is that handled automatically in the PCI infrastructure code which calls the Device Probe and Remove routines? Mostly I was just being an obsessively clean housewife assuming that we'd want to clean up these references ...

No, 'pci_set_drvdata(pdev, NULL) under err_free_adapter label' is not necessary.

As you know, pci_set_drvdata(pdev, NULL) calls dev_set_drvdata() as below:
pci_set_drvdata(pdev, NULL) is dev_set_drvdata(&pdev->dev, NULL).

./include/linux/pci.h
1504:static inline void pci_set_drvdata(struct pci_dev *pdev, void *data) 1505{
1506 dev_set_drvdata(&pdev->dev, data);
1507}

However, when the driver goes to err_free_adapter label, The following sequence will be done.

     kfree(adapter) -> .... -> return -ENOMEM;

In this case,
when probe() returns error value such as '-ENOMEM', really_probe() of driver core automatically calls 'dev_set_drvdata(dev, NULL)' as below:

./drivers/base/dd.c
303-probe_failed:
304 devres_release_all(dev);
305 driver_sysfs_remove(dev);
306 dev->driver = NULL;
307 dev_set_drvdata(dev, NULL);

Thus, without 'pci_set_drvdata(pdev, NULL) under err_free_adapter label', dev_set_drvdata(dev, NULL) can be called.

I already tested this with other drivers such as e1000e LAN card driver.

Best regards,
Jingoo Han

author
#20 lore raw

PATCH 15/52 net: enic: remove unnecessary pci_set_drvdata()

In reply to Jingoo Han

The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.

---
 drivers/net/ethernet/cisco/enic/enic_main.c |    2 --
 1 file changed, 2 deletions(-)
drivers/net/ethernet/cisco/enic/enic_main.c +0 -2
index 7b756cf9..ff78dfa 100644
@@ -2309,7 +2309,6 @@ err_out_release_regions:
 err_out_disable_device:
 	pci_disable_device(pdev);
 err_out_free_netdev:
-	pci_set_drvdata(pdev, NULL);
 	free_netdev(netdev);
 
 	return err;
@@ -2338,7 +2337,6 @@ static void enic_remove(struct pci_dev *pdev)
 		enic_iounmap(enic);
 		pci_release_regions(pdev);
 		pci_disable_device(pdev);
-		pci_set_drvdata(pdev, NULL);
 		free_netdev(netdev);
 	}
 }
Signature · 1 line
1.7.10.4
author
#21 lore raw

PATCH 16/52 net: tulip: remove unnecessary pci_set_drvdata()

In reply to Jingoo Han
Quoted 1 line

From 0ac65a86b433bc21a50ea07c923e0060e472bf2b Mon Sep 17 00:00:00 2001

From: Jingoo Han <[email protected]>
Date: Wed, 11 Sep 2013 14:30:15 +0900
Subject: [PATCH 16/52] net: tulip: remove unnecessary pci_set_drvdata()

The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.

---
 drivers/net/ethernet/dec/tulip/de2104x.c     |    1 -
 drivers/net/ethernet/dec/tulip/dmfe.c        |    3 ---
 drivers/net/ethernet/dec/tulip/tulip_core.c  |    1 -
 drivers/net/ethernet/dec/tulip/uli526x.c     |    2 --
 drivers/net/ethernet/dec/tulip/winbond-840.c |    3 ---
 drivers/net/ethernet/dec/tulip/xircom_cb.c   |    2 --
 6 files changed, 12 deletions(-)
drivers/net/ethernet/dec/tulip/de2104x.c +0 -1
index eaab73c..38148b0 100644
@@ -2110,7 +2110,6 @@ static void de_remove_one(struct pci_dev *pdev)
 	iounmap(de->regs);
 	pci_release_regions(pdev);
 	pci_disable_device(pdev);
-	pci_set_drvdata(pdev, NULL);
 	free_netdev(dev);
 }
 
drivers/net/ethernet/dec/tulip/dmfe.c +0 -3
index 8313930..5ad9e3e 100644
@@ -523,7 +523,6 @@ err_out_res:
 err_out_disable:
 	pci_disable_device(pdev);
 err_out_free:
-	pci_set_drvdata(pdev, NULL);
 	free_netdev(dev);
 
 	return err;
@@ -548,8 +547,6 @@ static void dmfe_remove_one(struct pci_dev *pdev)
 					db->buf_pool_ptr, db->buf_pool_dma_ptr);
 		pci_release_regions(pdev);
 		free_netdev(dev);	/* free board information */
-
-		pci_set_drvdata(pdev, NULL);
 	}
 
 	DMFE_DBUG(0, "dmfe_remove_one() exit", 0);
drivers/net/ethernet/dec/tulip/tulip_core.c +0 -1
index 4e8cfa2..add05f1 100644
@@ -1939,7 +1939,6 @@ static void tulip_remove_one(struct pci_dev *pdev)
 	pci_iounmap(pdev, tp->base_addr);
 	free_netdev (dev);
 	pci_release_regions (pdev);
-	pci_set_drvdata (pdev, NULL);
 
 	/* pci_power_off (pdev, -1); */
 }
drivers/net/ethernet/dec/tulip/uli526x.c +0 -2
index 93845af..a5397b1 100644
@@ -429,7 +429,6 @@ err_out_release:
 err_out_disable:
 	pci_disable_device(pdev);
 err_out_free:
-	pci_set_drvdata(pdev, NULL);
 	free_netdev(dev);
 
 	return err;
@@ -450,7 +449,6 @@ static void uli526x_remove_one(struct pci_dev *pdev)
 				db->buf_pool_ptr, db->buf_pool_dma_ptr);
 	pci_release_regions(pdev);
 	pci_disable_device(pdev);
-	pci_set_drvdata(pdev, NULL);
 	free_netdev(dev);
 }
 
drivers/net/ethernet/dec/tulip/winbond-840.c +0 -3
index c7b04ec..62fe512 100644
@@ -468,7 +468,6 @@ static int w840_probe1(struct pci_dev *pdev, const struct pci_device_id *ent)
 	return 0;
 
 err_out_cleardev:
-	pci_set_drvdata(pdev, NULL);
 	pci_iounmap(pdev, ioaddr);
 err_out_free_res:
 	pci_release_regions(pdev);
@@ -1542,8 +1541,6 @@ static void w840_remove1(struct pci_dev *pdev)
 		pci_iounmap(pdev, np->base_addr);
 		free_netdev(dev);
 	}
-
-	pci_set_drvdata(pdev, NULL);
 }
 
 #ifdef CONFIG_PM
drivers/net/ethernet/dec/tulip/xircom_cb.c +0 -2
index 9b84cb0..ab7ebac 100644
@@ -289,7 +289,6 @@ out:
 err_unmap:
 	pci_iounmap(pdev, private->ioaddr);
 reg_fail:
-	pci_set_drvdata(pdev, NULL);
 	dma_free_coherent(d, 8192, private->tx_buffer, private->tx_dma_handle);
 tx_buf_fail:
 	dma_free_coherent(d, 8192, private->rx_buffer, private->rx_dma_handle);
@@ -317,7 +316,6 @@ static void xircom_remove(struct pci_dev *pdev)
 
 	unregister_netdev(dev);
 	pci_iounmap(pdev, card->ioaddr);
-	pci_set_drvdata(pdev, NULL);
 	dma_free_coherent(d, 8192, card->tx_buffer, card->tx_dma_handle);
 	dma_free_coherent(d, 8192, card->rx_buffer, card->rx_dma_handle);
 	free_netdev(dev);
Signature · 1 line
1.7.10.4
author
#22 lore raw

PATCH 17/52 net: sundance: remove unnecessary pci_set_drvdata()

In reply to Jingoo Han

The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.

---
 drivers/net/ethernet/dlink/sundance.c |    2 --
 1 file changed, 2 deletions(-)
drivers/net/ethernet/dlink/sundance.c +0 -2
index bf3bf6f..113cd79 100644
@@ -703,7 +703,6 @@ err_out_unmap_tx:
 	dma_free_coherent(&pdev->dev, TX_TOTAL_SIZE,
 		np->tx_ring, np->tx_ring_dma);
 err_out_cleardev:
-	pci_set_drvdata(pdev, NULL);
 	pci_iounmap(pdev, ioaddr);
 err_out_res:
 	pci_release_regions(pdev);
@@ -1941,7 +1940,6 @@ static void sundance_remove1(struct pci_dev *pdev)
 	    pci_iounmap(pdev, np->base);
 	    pci_release_regions(pdev);
 	    free_netdev(dev);
-	    pci_set_drvdata(pdev, NULL);
 	}
 }
 
Signature · 1 line
1.7.10.4
author
#23 lore raw

PATCH 18/52 net: dl2k: remove unnecessary pci_set_drvdata()

In reply to Jingoo Han

The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.

---
 drivers/net/ethernet/dlink/dl2k.c |    1 -
 1 file changed, 1 deletion(-)
drivers/net/ethernet/dlink/dl2k.c +0 -1
index afa8e3a..4fb756d 100644
@@ -1746,7 +1746,6 @@ rio_remove1 (struct pci_dev *pdev)
 		pci_release_regions (pdev);
 		pci_disable_device (pdev);
 	}
-	pci_set_drvdata (pdev, NULL);
 }
 
 static struct pci_driver rio_driver = {
Signature · 1 line
1.7.10.4
author
#24 lore raw

PATCH 19/52 net: be2net: remove unnecessary pci_set_drvdata()

In reply to Jingoo Han

The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.

---
 drivers/net/ethernet/emulex/benet/be_main.c |    2 --
 1 file changed, 2 deletions(-)
drivers/net/ethernet/emulex/benet/be_main.c +0 -2
index 3224d28..80a819a 100644
@@ -4097,7 +4097,6 @@ static void be_remove(struct pci_dev *pdev)
 
 	pci_disable_pcie_error_reporting(pdev);
 
-	pci_set_drvdata(pdev, NULL);
 	pci_release_regions(pdev);
 	pci_disable_device(pdev);
 
@@ -4427,7 +4426,6 @@ ctrl_clean:
 	be_ctrl_cleanup(adapter);
 free_netdev:
 	free_netdev(netdev);
-	pci_set_drvdata(pdev, NULL);
 rel_reg:
 	pci_release_regions(pdev);
 disable_dev:
Signature · 1 line
1.7.10.4
author
#25 lore raw

PATCH 20/52 net: fealnx: remove unnecessary pci_set_drvdata()

In reply to Jingoo Han

The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.

---
 drivers/net/ethernet/fealnx.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/fealnx.c +2 -2
index c706b7a..99194d1 100644
@@ -699,9 +699,9 @@ static void fealnx_remove_one(struct pci_dev *pdev)
 		pci_iounmap(pdev, np->mem);
 		free_netdev(dev);
 		pci_release_regions(pdev);
-		pci_set_drvdata(pdev, NULL);
-	} else
+	} else {
 		printk(KERN_ERR "fealnx: remove for unknown device\n");
+	}
 }
 
 
Signature · 1 line
1.7.10.4
#26 lore raw

Re: [PATCH 20/52] net: fealnx: remove unnecessary pci_set_drvdata()

Hello.

Quoted 14 lines · Jingoo Han

The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.

---
  drivers/net/ethernet/fealnx.c |    4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/fealnx.c +0 -0
index c706b7a..99194d1 100644

drivers/net/ethernet/fealnx.c static void fealnx_remove_one(struct pci_dev *pdev) · line 704

Quoted 8 lines
drivers/net/ethernet/fealnx.c +2 -2
@@ -699,9 +699,9 @@ static void fealnx_remove_one(struct pci_dev *pdev)
  		pci_iounmap(pdev, np->mem);
  		free_netdev(dev);
  		pci_release_regions(pdev);
-		pci_set_drvdata(pdev, NULL);
-	} else
+	} else {
  		printk(KERN_ERR "fealnx: remove for unknown device\n");
+	}

No "drove-by" coding style fixes, please.

WBR, Sergei

author
#27 lore raw

Re: [PATCH 20/52] net: fealnx: remove unnecessary pci_set_drvdata()

Quoted 11 lines · Jingoo Han
Quoted 8 lines · Jingoo Han

The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.

---
  drivers/net/ethernet/fealnx.c |    4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
Quoted 15 lines

drivers/net/ethernet/fealnx.c static void fealnx_remove_one(struct pci_dev *pdev) · line 704

Quoted 13 lines
drivers/net/ethernet/fealnx.c +2 -2
index c706b7a..99194d1 100644
@@ -699,9 +699,9 @@ static void fealnx_remove_one(struct pci_dev *pdev)
  		pci_iounmap(pdev, np->mem);
  		free_netdev(dev);
  		pci_release_regions(pdev);
-		pci_set_drvdata(pdev, NULL);
-	} else
+	} else {
  		printk(KERN_ERR "fealnx: remove for unknown device\n");
+	}

No "drove-by" coding style fixes, please.

Hi Sergei,

Sorry, but I just want to know the reason. :-) Would you let know the reason not to add coding style fixes? Thank you.

Best regards,
Jingoo Han

maintainer
#28 lore raw

Re: [PATCH 20/52] net: fealnx: remove unnecessary pci_set_drvdata()

From: Jingoo Han <[email protected]>
Date: Thu, 12 Sep 2013 09:11:01 +0900

Quoted 1 line

Would you let know the reason not to add coding style fixes?

They should be made seperately so that the individual changes can be reviewed more easily and without unnecessary unrelated changes mixed in.

author
#29 lore raw

Re: [PATCH 20/52] net: fealnx: remove unnecessary pci_set_drvdata()

Quoted 6 lines · David Miller
Quoted 1 line · Jingoo Han

Would you let know the reason not to add coding style fixes?

They should be made seperately so that the individual changes can be reviewed more easily and without unnecessary unrelated changes mixed in.

OK, I see. :-)
Thank you for your answer.
Then, I will send V2 patch soon.

Best regards,
Jingoo Han

maintainer
#30 lore raw

Re: [PATCH 20/52] net: fealnx: remove unnecessary pci_set_drvdata()

From: Jingoo Han <[email protected]>
Date: Thu, 12 Sep 2013 14:49:56 +0900

Quoted 11 lines · David Miller
Quoted 6 lines · Jingoo Han
Quoted 1 line

Would you let know the reason not to add coding style fixes?

They should be made seperately so that the individual changes can be reviewed more easily and without unnecessary unrelated changes mixed in.

OK, I see. :-)
Thank you for your answer.
Then, I will send V2 patch soon.

Please do not submit such a huge patch series in the future.

Anything more than 16 patches at a time is not reasonable and overloads reviewer's capacity to look at your changes.

Thank you.

author
#31 lore raw

Re: [PATCH 20/52] net: fealnx: remove unnecessary pci_set_drvdata()

Quoted 9 lines · David Miller
Quoted 8 lines · Jingoo Han
Quoted 6 lines · David Miller
Quoted 1 line · Jingoo Han

Would you let know the reason not to add coding style fixes?

They should be made seperately so that the individual changes can be reviewed more easily and without unnecessary unrelated changes mixed in.

Quoted 9 lines
Quoted 3 lines

OK, I see. :-)
Thank you for your answer.
Then, I will send V2 patch soon.

Please do not submit such a huge patch series in the future.

Anything more than 16 patches at a time is not reasonable and overloads reviewer's capacity to look at your changes.

Then, in this case,
I have to split the patches into several chunks, and send them over few weeks?
For example,
one day: 15 patches
2 weeks later: 15 patches
2 weeks later: 15 patches
2 weeks later: 7 patches

Best regards,
Jingoo Han

maintainer
#32 lore raw

Re: [PATCH 20/52] net: fealnx: remove unnecessary pci_set_drvdata()

From: Jingoo Han <[email protected]>
Date: Thu, 12 Sep 2013 16:54:14 +0900

Quoted 7 lines

I have to split the patches into several chunks, and send them over few weeks?
For example,
one day: 15 patches
2 weeks later: 15 patches
2 weeks later: 15 patches
2 weeks later: 7 patches

You can send the new chunk after I apply the previous one.

author
#33 lore raw

Re: [PATCH 20/52] net: fealnx: remove unnecessary pci_set_drvdata()

Quoted 11 lines · David Miller
Quoted 7 lines · Jingoo Han

I have to split the patches into several chunks, and send them over few weeks?
For example,
one day: 15 patches
2 weeks later: 15 patches
2 weeks later: 15 patches
2 weeks later: 7 patches

You can send the new chunk after I apply the previous one.

OK, I see.
I will do so as you guide. :-)
I will be more careful.
Thank you for your guidance.

Best regards,
Jingoo Han

#34 lore raw

Re: [PATCH 20/52] net: fealnx: remove unnecessary pci_set_drvdata()

In reply to David Miller
Quoted 11 lines · David Miller

From: Jingoo Han <[email protected]>
Date: Thu, 12 Sep 2013 14:49:56 +0900

Quoted 8 lines · David Miller
Quoted 6 lines · Jingoo Han
Quoted 1 line

Would you let know the reason not to add coding style fixes?

They should be made seperately so that the individual changes can be reviewed more easily and without unnecessary unrelated changes mixed in.

Quoted 8 lines
Quoted 3 lines

OK, I see. :-)
Thank you for your answer.
Then, I will send V2 patch soon.

Please do not submit such a huge patch series in the future.

Anything more than 16 patches at a time is not reasonable and overloads reviewer's capacity to look at your changes.

Given that this is the same trivial change applied to many different drivers, is it really worthwhile to break it up into a patch per driver?

Ben.

Signature · 3 lines
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
#35 lore raw

Re: [PATCH 20/52] net: fealnx: remove unnecessary pci_set_drvdata()

In reply to Jingoo Han

Hello.

Quoted 25 lines · Jingoo Han
Quoted 9 lines
Quoted 8 lines

The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.

---
   drivers/net/ethernet/fealnx.c |    4 ++--
   1 file changed, 2 insertions(+), 2 deletions(-)
Quoted 15 lines

drivers/net/ethernet/fealnx.c static void fealnx_remove_one(struct pci_dev *pdev) · line 704

Quoted 13 lines
drivers/net/ethernet/fealnx.c +2 -2
index c706b7a..99194d1 100644
@@ -699,9 +699,9 @@ static void fealnx_remove_one(struct pci_dev *pdev)
   		pci_iounmap(pdev, np->mem);
   		free_netdev(dev);
   		pci_release_regions(pdev);
-		pci_set_drvdata(pdev, NULL);
-	} else
+	} else {
   		printk(KERN_ERR "fealnx: remove for unknown device\n");
+	}

No "drove-by" coding style fixes, please.

Quoted 4 lines

Hi Sergei,

Sorry, but I just want to know the reason. :-) Would you let know the reason not to add coding style fixes?

This change doesn't get covered by the patch subject/changelog. Even if
you're doing it, it should preferably be done in a separate patch and at the very least documented in the changelog.

Quoted 1 line

Thank you.

Not at all.

Quoted 2 lines

Best regards,
Jingoo Han

WBR, Sergei

author
#36 lore raw

PATCH v2 20/52 net: fealnx: remove unnecessary pci_set_drvdata()

In reply to Jingoo Han

The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.

---
Changes since v1:
- removed coding style fix.

 drivers/net/ethernet/fealnx.c |    1 -
 1 file changed, 1 deletion(-)
drivers/net/ethernet/fealnx.c +0 -1
index c706b7a..4b22a95 100644
@@ -699,7 +699,6 @@ static void fealnx_remove_one(struct pci_dev *pdev)
 		pci_iounmap(pdev, np->mem);
 		free_netdev(dev);
 		pci_release_regions(pdev);
-		pci_set_drvdata(pdev, NULL);
 	} else
 		printk(KERN_ERR "fealnx: remove for unknown device\n");
 }
Signature · 1 line
1.7.10.4
author
#37 lore raw

PATCH 21/52 net: icplus: remove unnecessary pci_set_drvdata()

In reply to Jingoo Han

The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.

---
 drivers/net/ethernet/icplus/ipg.c |    1 -
 1 file changed, 1 deletion(-)
drivers/net/ethernet/icplus/ipg.c +0 -1
index bdf5023..25045ae 100644
@@ -2183,7 +2183,6 @@ static void ipg_remove(struct pci_dev *pdev)
 
 	free_netdev(dev);
 	pci_disable_device(pdev);
-	pci_set_drvdata(pdev, NULL);
 }
 
 static const struct net_device_ops ipg_netdev_ops = {
Signature · 1 line
1.7.10.4
author
#38 lore raw

PATCH 22/52 net: e100: remove unnecessary pci_set_drvdata()

In reply to Jingoo Han

The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.

---
 drivers/net/ethernet/intel/e100.c |    2 --
 1 file changed, 2 deletions(-)
drivers/net/ethernet/intel/e100.c +0 -2
index ada6e21..cbaba44 100644
@@ -2985,7 +2985,6 @@ err_out_free_res:
 err_out_disable_pdev:
 	pci_disable_device(pdev);
 err_out_free_dev:
-	pci_set_drvdata(pdev, NULL);
 	free_netdev(netdev);
 	return err;
 }
@@ -3003,7 +3002,6 @@ static void e100_remove(struct pci_dev *pdev)
 		free_netdev(netdev);
 		pci_release_regions(pdev);
 		pci_disable_device(pdev);
-		pci_set_drvdata(pdev, NULL);
 	}
 }
 
Signature · 1 line
1.7.10.4
#39 lore raw

Re: [PATCH 22/52] net: e100: remove unnecessary pci_set_drvdata()

Quoted 8 lines · Jingoo Han

The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.

---
 drivers/net/ethernet/intel/e100.c |    2 --
 1 file changed, 2 deletions(-)

While I do not find anything wrong with this patch, I personally like good housekeeping so I would like to keep the code as is. Is there a reason for this patch?

author
#40 lore raw

Re: [PATCH 22/52] net: e100: remove unnecessary pci_set_drvdata()

Quoted 5 lines · Jeff Kirsher
Quoted 4 lines · Jingoo Han

The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.

Quoted 8 lines
Quoted 4 lines
---
 drivers/net/ethernet/intel/e100.c |    2 --
 1 file changed, 2 deletions(-)

While I do not find anything wrong with this patch, I personally like good housekeeping so I would like to keep the code as is. Is there a reason for this patch?

Vice versa,
Is there any reason to keep unnecessary code?

Clearing drvdata is done by driver core, so each driver does not need to clear drvdata.
This patch reduces code size and removes duplicated functional execution.

Please consider it positively. :-)

Best regards,
Jingoo Han

author
#41 lore raw

PATCH 23/52 net: jme: remove unnecessary pci_set_drvdata()

In reply to Jingoo Han

The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.

---
 drivers/net/ethernet/jme.c |    2 --
 1 file changed, 2 deletions(-)
drivers/net/ethernet/jme.c +0 -2
index 23de82a..37dcd97 100644
@@ -3192,7 +3192,6 @@ jme_init_one(struct pci_dev *pdev,
 err_out_unmap:
 	iounmap(jme->regs);
 err_out_free_netdev:
-	pci_set_drvdata(pdev, NULL);
 	free_netdev(netdev);
 err_out_release_regions:
 	pci_release_regions(pdev);
@@ -3210,7 +3209,6 @@ jme_remove_one(struct pci_dev *pdev)
 
 	unregister_netdev(netdev);
 	iounmap(jme->regs);
-	pci_set_drvdata(pdev, NULL);
 	free_netdev(netdev);
 	pci_release_regions(pdev);
 	pci_disable_device(pdev);
Signature · 1 line
1.7.10.4
author
#42 lore raw

PATCH 24/52 net: skge: remove unnecessary pci_set_drvdata()

In reply to Jingoo Han

The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.

---
 drivers/net/ethernet/marvell/skge.c |    2 --
 1 file changed, 2 deletions(-)
drivers/net/ethernet/marvell/skge.c +0 -2
index ef94a59..8b3696f 100644
@@ -4042,7 +4042,6 @@ err_out_free_regions:
 	pci_release_regions(pdev);
 err_out_disable_pdev:
 	pci_disable_device(pdev);
-	pci_set_drvdata(pdev, NULL);
 err_out:
 	return err;
 }
@@ -4086,7 +4085,6 @@ static void skge_remove(struct pci_dev *pdev)
 
 	iounmap(hw->regs);
 	kfree(hw);
-	pci_set_drvdata(pdev, NULL);
 }
 
 #ifdef CONFIG_PM_SLEEP
Signature · 1 line
1.7.10.4
author
#43 lore raw

PATCH 25/52 net: sky2: remove unnecessary pci_set_drvdata()

In reply to Jingoo Han

The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.

---
 drivers/net/ethernet/marvell/sky2.c |    3 ---
 1 file changed, 3 deletions(-)
drivers/net/ethernet/marvell/sky2.c +0 -3
index e09a8c6..a7df981 100644
@@ -5081,7 +5081,6 @@ err_out_free_regions:
 err_out_disable:
 	pci_disable_device(pdev);
 err_out:
-	pci_set_drvdata(pdev, NULL);
 	return err;
 }
 
@@ -5124,8 +5123,6 @@ static void sky2_remove(struct pci_dev *pdev)
 
 	iounmap(hw->regs);
 	kfree(hw);
-
-	pci_set_drvdata(pdev, NULL);
 }
 
 static int sky2_suspend(struct device *dev)
Signature · 1 line
1.7.10.4
author
#44 lore raw

PATCH 26/52 net: ksz884x: remove unnecessary pci_set_drvdata()

In reply to Jingoo Han

The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.

---
 drivers/net/ethernet/micrel/ksz884x.c |    2 --
 1 file changed, 2 deletions(-)
drivers/net/ethernet/micrel/ksz884x.c +0 -2
index 8ebc352..6462dc5 100644
@@ -7150,8 +7150,6 @@ static void pcidev_exit(struct pci_dev *pdev)
 	struct platform_info *info = pci_get_drvdata(pdev);
 	struct dev_info *hw_priv = &info->dev_info;
 
-	pci_set_drvdata(pdev, NULL);
-
 	release_mem_region(pci_resource_start(pdev, 0),
 		pci_resource_len(pdev, 0));
 	for (i = 0; i < hw_priv->hw.dev_count; i++) {
Signature · 1 line
1.7.10.4
author
#45 lore raw

PATCH 27/52 net: myri10ge: remove unnecessary pci_set_drvdata()

In reply to Jingoo Han

The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.

---
 drivers/net/ethernet/myricom/myri10ge/myri10ge.c |    1 -
 1 file changed, 1 deletion(-)
drivers/net/ethernet/myricom/myri10ge/myri10ge.c +0 -1
index 149355b..234b330 100644
@@ -4208,7 +4208,6 @@ static void myri10ge_remove(struct pci_dev *pdev)
 	set_fw_name(mgp, NULL, false);
 	free_netdev(netdev);
 	pci_disable_device(pdev);
-	pci_set_drvdata(pdev, NULL);
 }
 
 #define PCI_DEVICE_ID_MYRICOM_MYRI10GE_Z8E 	0x0008
Signature · 1 line
1.7.10.4
author
#46 lore raw

PATCH 28/52 net: natsemi: remove unnecessary pci_set_drvdata()

In reply to Jingoo Han

The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.

---
 drivers/net/ethernet/natsemi/natsemi.c |    2 --
 1 file changed, 2 deletions(-)
drivers/net/ethernet/natsemi/natsemi.c +0 -2
index 7a5e295..64ec2a4 100644
@@ -970,7 +970,6 @@ static int natsemi_probe1(struct pci_dev *pdev, const struct pci_device_id *ent)
 
  err_ioremap:
 	pci_release_regions(pdev);
-	pci_set_drvdata(pdev, NULL);
 
  err_pci_request_regions:
 	free_netdev(dev);
@@ -3220,7 +3219,6 @@ static void natsemi_remove1(struct pci_dev *pdev)
 	pci_release_regions (pdev);
 	iounmap(ioaddr);
 	free_netdev (dev);
-	pci_set_drvdata(pdev, NULL);
 }
 
 #ifdef CONFIG_PM
Signature · 1 line
1.7.10.4
author
#47 lore raw

PATCH 29/52 net: neterion: remove unnecessary pci_set_drvdata()

In reply to Jingoo Han

The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.

---
 drivers/net/ethernet/neterion/s2io.c           |    2 --
 drivers/net/ethernet/neterion/vxge/vxge-main.c |    2 --
 2 files changed, 4 deletions(-)
drivers/net/ethernet/neterion/s2io.c +0 -2
index 51b0094..9eeddbd 100644
@@ -8185,7 +8185,6 @@ mem_alloc_failed:
 	free_shared_mem(sp);
 	pci_disable_device(pdev);
 	pci_release_regions(pdev);
-	pci_set_drvdata(pdev, NULL);
 	free_netdev(dev);
 
 	return ret;
@@ -8221,7 +8220,6 @@ static void s2io_rem_nic(struct pci_dev *pdev)
 	iounmap(sp->bar0);
 	iounmap(sp->bar1);
 	pci_release_regions(pdev);
-	pci_set_drvdata(pdev, NULL);
 	free_netdev(dev);
 	pci_disable_device(pdev);
 }
drivers/net/ethernet/neterion/vxge/vxge-main.c +0 -2
index 5a20eaf..8614eeb 100644
@@ -4739,7 +4739,6 @@ _exit6:
 _exit5:
 	vxge_device_unregister(hldev);
 _exit4:
-	pci_set_drvdata(pdev, NULL);
 	vxge_hw_device_terminate(hldev);
 	pci_disable_sriov(pdev);
 _exit3:
@@ -4782,7 +4781,6 @@ static void vxge_remove(struct pci_dev *pdev)
 		vxge_free_mac_add_list(&vdev->vpaths[i]);
 
 	vxge_device_unregister(hldev);
-	pci_set_drvdata(pdev, NULL);
 	/* Do not call pci_disable_sriov here, as it will break child devices */
 	vxge_hw_device_terminate(hldev);
 	iounmap(vdev->bar0);
Signature · 1 line
1.7.10.4
Acked-by on v1 29/52
#48 lore raw

Re: [PATCH 29/52] net: neterion: remove unnecessary pci_set_drvdata()

Quoted 5 lines · Jingoo Han

The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.

Looks sane to me.

Quoted 49 lines
---
 drivers/net/ethernet/neterion/s2io.c           |    2 --
 drivers/net/ethernet/neterion/vxge/vxge-main.c |    2 --
 2 files changed, 4 deletions(-)
drivers/net/ethernet/neterion/s2io.c +0 -2
index 51b0094..9eeddbd 100644
@@ -8185,7 +8185,6 @@ mem_alloc_failed:
        free_shared_mem(sp);
        pci_disable_device(pdev);
        pci_release_regions(pdev);
-       pci_set_drvdata(pdev, NULL);
        free_netdev(dev);
 
        return ret;
@@ -8221,7 +8220,6 @@ static void s2io_rem_nic(struct pci_dev *pdev)
        iounmap(sp->bar0);
        iounmap(sp->bar1);
        pci_release_regions(pdev);
-       pci_set_drvdata(pdev, NULL);
        free_netdev(dev);
        pci_disable_device(pdev);
 }
drivers/net/ethernet/neterion/vxge/vxge-main.c +0 -3
index 5a20eaf..8614eeb 100644
@@ -4739,7 +4739,6 @@ _exit6:
 _exit5:
        vxge_device_unregister(hldev);
 _exit4:
-       pci_set_drvdata(pdev, NULL);
        vxge_hw_device_terminate(hldev);
        pci_disable_sriov(pdev);
 _exit3:
@@ -4782,7 +4781,6 @@ static void vxge_remove(struct pci_dev *pdev)
                vxge_free_mac_add_list(&vdev->vpaths[i]);
 
        vxge_device_unregister(hldev);
-       pci_set_drvdata(pdev, NULL);
        /* Do not call pci_disable_sriov here, as it will break child devices */
        vxge_hw_device_terminate(hldev);
        iounmap(vdev->bar0);
--

1.7.10.4

author
#49 lore raw

PATCH 30/52 net: packetengines: remove unnecessary pci_set_drvdata()

In reply to Jingoo Han

The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.

---
 drivers/net/ethernet/packetengines/hamachi.c   |    1 -
 drivers/net/ethernet/packetengines/yellowfin.c |    2 --
 2 files changed, 3 deletions(-)
drivers/net/ethernet/packetengines/hamachi.c +0 -1
index cac33e5..b6bdeb3 100644
@@ -1910,7 +1910,6 @@ static void hamachi_remove_one(struct pci_dev *pdev)
 		iounmap(hmp->base);
 		free_netdev(dev);
 		pci_release_regions(pdev);
-		pci_set_drvdata(pdev, NULL);
 	}
 }
 
drivers/net/ethernet/packetengines/yellowfin.c +0 -2
index d28593b..07a890e 100644
@@ -513,7 +513,6 @@ err_out_unmap_rx:
 err_out_unmap_tx:
         pci_free_consistent(pdev, TX_TOTAL_SIZE, np->tx_ring, np->tx_ring_dma);
 err_out_cleardev:
-	pci_set_drvdata(pdev, NULL);
 	pci_iounmap(pdev, ioaddr);
 err_out_free_res:
 	pci_release_regions(pdev);
@@ -1392,7 +1391,6 @@ static void yellowfin_remove_one(struct pci_dev *pdev)
 	pci_release_regions (pdev);
 
 	free_netdev (dev);
-	pci_set_drvdata(pdev, NULL);
 }
 
 
Signature · 1 line
1.7.10.4
author
#50 lore raw

PATCH 31/52 net: pasemi: remove unnecessary pci_set_drvdata()

In reply to Jingoo Han

The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.

---
 drivers/net/ethernet/pasemi/pasemi_mac.c |    1 -
 1 file changed, 1 deletion(-)
drivers/net/ethernet/pasemi/pasemi_mac.c +0 -1
index c498181..47ddedb 100644
@@ -1870,7 +1870,6 @@ static void pasemi_mac_remove(struct pci_dev *pdev)
 	pasemi_dma_free_chan(&mac->tx->chan);
 	pasemi_dma_free_chan(&mac->rx->chan);
 
-	pci_set_drvdata(pdev, NULL);
 	free_netdev(netdev);
 }
 
Signature · 1 line
1.7.10.4
author
#51 lore raw

PATCH 32/52 net: netxen: remove unnecessary pci_set_drvdata()

In reply to Jingoo Han

The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.

---
 drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c |    2 --
 1 file changed, 2 deletions(-)
drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c +0 -2
index cbd75f9..76b8e35 100644
@@ -1602,7 +1602,6 @@ err_out_free_res:
 	pci_release_regions(pdev);
 
 err_out_disable_pdev:
-	pci_set_drvdata(pdev, NULL);
 	pci_disable_device(pdev);
 	return err;
 }
@@ -1661,7 +1660,6 @@ static void netxen_nic_remove(struct pci_dev *pdev)
 
 	pci_release_regions(pdev);
 	pci_disable_device(pdev);
-	pci_set_drvdata(pdev, NULL);
 
 	free_netdev(netdev);
 }
Signature · 1 line
1.7.10.4
author
#52 lore raw

PATCH 33/52 net: qlge: remove unnecessary pci_set_drvdata()

In reply to Jingoo Han

The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.

---
 drivers/net/ethernet/qlogic/qlge/qlge_main.c |    1 -
 1 file changed, 1 deletion(-)
drivers/net/ethernet/qlogic/qlge/qlge_main.c +0 -1
index 2553cf4..d22529c 100644
@@ -4505,7 +4505,6 @@ static void ql_release_all(struct pci_dev *pdev)
 		iounmap(qdev->doorbell_area);
 	vfree(qdev->mpi_coredump);
 	pci_release_regions(pdev);
-	pci_set_drvdata(pdev, NULL);
 }
 
 static int ql_init_device(struct pci_dev *pdev, struct net_device *ndev,
Signature · 1 line
1.7.10.4
author
#53 lore raw

PATCH 34/52 net: qlcnic: remove unnecessary pci_set_drvdata()

In reply to Jingoo Han

The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.

---
 drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c |    2 --
 1 file changed, 2 deletions(-)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c +0 -2
index c4c5023..00cc337 100644
@@ -2405,7 +2405,6 @@ err_out_free_res:
 	pci_release_regions(pdev);
 
 err_out_disable_pdev:
-	pci_set_drvdata(pdev, NULL);
 	pci_disable_device(pdev);
 	return err;
 }
@@ -2465,7 +2464,6 @@ static void qlcnic_remove(struct pci_dev *pdev)
 	pci_disable_pcie_error_reporting(pdev);
 	pci_release_regions(pdev);
 	pci_disable_device(pdev);
-	pci_set_drvdata(pdev, NULL);
 
 	if (adapter->qlcnic_wq) {
 		destroy_workqueue(adapter->qlcnic_wq);
Signature · 1 line
1.7.10.4
author
#54 lore raw

PATCH 35/52 net: qla3xxx: remove unnecessary pci_set_drvdata()

In reply to Jingoo Han

The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.

---
 drivers/net/ethernet/qlogic/qla3xxx.c |    2 --
 1 file changed, 2 deletions(-)
drivers/net/ethernet/qlogic/qla3xxx.c +0 -2
index 91a8fcd..0758b94 100644
@@ -3916,7 +3916,6 @@ err_out_free_regions:
 	pci_release_regions(pdev);
 err_out_disable_pdev:
 	pci_disable_device(pdev);
-	pci_set_drvdata(pdev, NULL);
 err_out:
 	return err;
 }
@@ -3939,7 +3938,6 @@ static void ql3xxx_remove(struct pci_dev *pdev)
 
 	iounmap(qdev->mem_map_registers);
 	pci_release_regions(pdev);
-	pci_set_drvdata(pdev, NULL);
 	free_netdev(ndev);
 }
 
Signature · 1 line
1.7.10.4
author
#55 lore raw

PATCH 36/52 net: r6040: remove unnecessary pci_set_drvdata()

In reply to Jingoo Han

The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.

---
 drivers/net/ethernet/rdc/r6040.c |    2 --
 1 file changed, 2 deletions(-)
drivers/net/ethernet/rdc/r6040.c +0 -2
index e9dc849..1e49ec5 100644
@@ -1231,7 +1231,6 @@ err_out_mdio:
 	mdiobus_free(lp->mii_bus);
 err_out_unmap:
 	netif_napi_del(&lp->napi);
-	pci_set_drvdata(pdev, NULL);
 	pci_iounmap(pdev, ioaddr);
 err_out_free_res:
 	pci_release_regions(pdev);
@@ -1257,7 +1256,6 @@ static void r6040_remove_one(struct pci_dev *pdev)
 	pci_release_regions(pdev);
 	free_netdev(dev);
 	pci_disable_device(pdev);
-	pci_set_drvdata(pdev, NULL);
 }
 
 
Signature · 1 line
1.7.10.4
author
#56 lore raw

PATCH 37/52 net: 8139cp: remove unnecessary pci_set_drvdata()

In reply to Jingoo Han

The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.

---
 drivers/net/ethernet/realtek/8139cp.c |    1 -
 1 file changed, 1 deletion(-)
drivers/net/ethernet/realtek/8139cp.c +0 -1
index d2e5919..f2a2128 100644
@@ -2052,7 +2052,6 @@ static void cp_remove_one (struct pci_dev *pdev)
 	pci_release_regions(pdev);
 	pci_clear_mwi(pdev);
 	pci_disable_device(pdev);
-	pci_set_drvdata(pdev, NULL);
 	free_netdev(dev);
 }
 
Signature · 1 line
1.7.10.4
author
#57 lore raw

PATCH 38/52 net: 8139too: remove unnecessary pci_set_drvdata()

In reply to Jingoo Han

The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.

---
 drivers/net/ethernet/realtek/8139too.c |    1 -
 1 file changed, 1 deletion(-)
drivers/net/ethernet/realtek/8139too.c +0 -1
index 3ccedeb..50a9210 100644
@@ -727,7 +727,6 @@ static void __rtl8139_cleanup_dev (struct net_device *dev)
 	pci_release_regions (pdev);
 
 	free_netdev(dev);
-	pci_set_drvdata (pdev, NULL);
 }
 
 
Signature · 1 line
1.7.10.4
author
#58 lore raw

PATCH 39/52 net: r8169: remove unnecessary pci_set_drvdata()

In reply to Jingoo Han

The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.

---
 drivers/net/ethernet/realtek/r8169.c |    1 -
 1 file changed, 1 deletion(-)
drivers/net/ethernet/realtek/r8169.c +0 -1
index 6f87f2c..c5f8e70 100644
@@ -6810,7 +6810,6 @@ static void rtl_remove_one(struct pci_dev *pdev)
 
 	rtl_disable_msi(pdev, tp);
 	rtl8169_release_board(pdev, dev, tp->mmio_addr);
-	pci_set_drvdata(pdev, NULL);
 }
 
 static const struct net_device_ops rtl_netdev_ops = {
Signature · 1 line
1.7.10.4
author
#59 lore raw

PATCH 40/52 net: sis190: remove unnecessary pci_set_drvdata()

In reply to Jingoo Han

The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.

---
 drivers/net/ethernet/sis/sis190.c |    1 -
 1 file changed, 1 deletion(-)
drivers/net/ethernet/sis/sis190.c +0 -1
index ee18e6f..acbbe48 100644
@@ -1921,7 +1921,6 @@ static void sis190_remove_one(struct pci_dev *pdev)
 	cancel_work_sync(&tp->phy_task);
 	unregister_netdev(dev);
 	sis190_release_board(pdev);
-	pci_set_drvdata(pdev, NULL);
 }
 
 static struct pci_driver sis190_pci_driver = {
Signature · 1 line
1.7.10.4
author
#60 lore raw

PATCH 41/52 net: epic100: remove unnecessary pci_set_drvdata()

In reply to Jingoo Han

The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.

---
 drivers/net/ethernet/smsc/epic100.c |    1 -
 1 file changed, 1 deletion(-)
drivers/net/ethernet/smsc/epic100.c +0 -1
index 03b256a..8c5c24a 100644
@@ -1535,7 +1535,6 @@ static void epic_remove_one(struct pci_dev *pdev)
 	pci_release_regions(pdev);
 	free_netdev(dev);
 	pci_disable_device(pdev);
-	pci_set_drvdata(pdev, NULL);
 	/* pci_power_off(pdev, -1); */
 }
 
Signature · 1 line
1.7.10.4
author
#61 lore raw

PATCH 42/52 net: smsc9420: remove unnecessary pci_set_drvdata()

In reply to Jingoo Han

The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.

---
 drivers/net/ethernet/smsc/smsc9420.c |    2 --
 1 file changed, 2 deletions(-)
drivers/net/ethernet/smsc/smsc9420.c +0 -2
index ffa5c4a..895634e 100644
@@ -1708,8 +1708,6 @@ static void smsc9420_remove(struct pci_dev *pdev)
 	if (!dev)
 		return;
 
-	pci_set_drvdata(pdev, NULL);
-
 	pd = netdev_priv(dev);
 	unregister_netdev(dev);
 
Signature · 1 line
1.7.10.4
author
#62 lore raw

PATCH 43/52 net: stmmac: remove unnecessary pci_set_drvdata()

In reply to Jingoo Han

The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.

---
 drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c |    1 -
 1 file changed, 1 deletion(-)
drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c +0 -1
index 023b7c2..644d80e 100644
@@ -138,7 +138,6 @@ static void stmmac_pci_remove(struct pci_dev *pdev)
 
 	stmmac_dvr_remove(ndev);
 
-	pci_set_drvdata(pdev, NULL);
 	pci_iounmap(pdev, priv->ioaddr);
 	pci_release_regions(pdev);
 	pci_disable_device(pdev);
Signature · 1 line
1.7.10.4
author
#63 lore raw

PATCH 44/52 net: sunhme: remove unnecessary pci_set_drvdata()

In reply to Jingoo Han

The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.

---
 drivers/net/ethernet/sun/sunhme.c |    2 --
 1 file changed, 2 deletions(-)
drivers/net/ethernet/sun/sunhme.c +0 -2
index e37b587..201cf63 100644
@@ -3170,8 +3170,6 @@ static void happy_meal_pci_remove(struct pci_dev *pdev)
 	pci_release_regions(hp->happy_dev);
 
 	free_netdev(net_dev);
-
-	pci_set_drvdata(pdev, NULL);
 }
 
 static DEFINE_PCI_DEVICE_TABLE(happymeal_pci_ids) = {
Signature · 1 line
1.7.10.4
author
#64 lore raw

PATCH 45/52 net: cassini: remove unnecessary pci_set_drvdata()

In reply to Jingoo Han

The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.

---
 drivers/net/ethernet/sun/cassini.c |    2 --
 1 file changed, 2 deletions(-)
drivers/net/ethernet/sun/cassini.c +0 -2
index 759441b..817611d 100644
@@ -5168,7 +5168,6 @@ err_out_free_netdev:
 
 err_out_disable_pdev:
 	pci_disable_device(pdev);
-	pci_set_drvdata(pdev, NULL);
 	return -ENODEV;
 }
 
@@ -5206,7 +5205,6 @@ static void cas_remove_one(struct pci_dev *pdev)
 	free_netdev(dev);
 	pci_release_regions(pdev);
 	pci_disable_device(pdev);
-	pci_set_drvdata(pdev, NULL);
 }
 
 #ifdef CONFIG_PM
Signature · 1 line
1.7.10.4
author
#65 lore raw

PATCH 46/52 net: sungem: remove unnecessary pci_set_drvdata()

In reply to Jingoo Han

The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.

---
 drivers/net/ethernet/sun/sungem.c |    2 --
 1 file changed, 2 deletions(-)
drivers/net/ethernet/sun/sungem.c +0 -2
index e62df2b..e115bb1 100644
@@ -2806,8 +2806,6 @@ static void gem_remove_one(struct pci_dev *pdev)
 		iounmap(gp->regs);
 		pci_release_regions(pdev);
 		free_netdev(dev);
-
-		pci_set_drvdata(pdev, NULL);
 	}
 }
 
Signature · 1 line
1.7.10.4
author
#66 lore raw

PATCH 47/52 net: niu: remove unnecessary pci_set_drvdata()

In reply to Jingoo Han

The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.

---
 drivers/net/ethernet/sun/niu.c |    2 --
 1 file changed, 2 deletions(-)
drivers/net/ethernet/sun/niu.c +0 -2
index f28460c..388540f 100644
@@ -9875,7 +9875,6 @@ err_out_free_res:
 
 err_out_disable_pdev:
 	pci_disable_device(pdev);
-	pci_set_drvdata(pdev, NULL);
 
 	return err;
 }
@@ -9900,7 +9899,6 @@ static void niu_pci_remove_one(struct pci_dev *pdev)
 		free_netdev(dev);
 		pci_release_regions(pdev);
 		pci_disable_device(pdev);
-		pci_set_drvdata(pdev, NULL);
 	}
 }
 
Signature · 1 line
1.7.10.4
author
#67 lore raw

PATCH 48/52 net: tehuti: remove unnecessary pci_set_drvdata()

In reply to Jingoo Han

The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.

---
 drivers/net/ethernet/tehuti/tehuti.c |    1 -
 1 file changed, 1 deletion(-)
drivers/net/ethernet/tehuti/tehuti.c +0 -1
index 571452e..dd0dd627 100644
@@ -2447,7 +2447,6 @@ static void bdx_remove(struct pci_dev *pdev)
 	iounmap(nic->regs);
 	pci_release_regions(pdev);
 	pci_disable_device(pdev);
-	pci_set_drvdata(pdev, NULL);
 	vfree(nic);
 
 	RET();
Signature · 1 line
1.7.10.4
author
#68 lore raw

PATCH 49/52 net: tlan: remove unnecessary pci_set_drvdata()

In reply to Jingoo Han

The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.

---
 drivers/net/ethernet/ti/tlan.c |    1 -
 1 file changed, 1 deletion(-)
drivers/net/ethernet/ti/tlan.c +0 -1
index 591437e..62b19be 100644
@@ -319,7 +319,6 @@ static void tlan_remove_one(struct pci_dev *pdev)
 
 	free_netdev(dev);
 
-	pci_set_drvdata(pdev, NULL);
 	cancel_work_sync(&priv->tlan_tqueue);
 }
 
Signature · 1 line
1.7.10.4
author
#69 lore raw

PATCH 50/52 net: spider_net: remove unnecessary pci_set_drvdata()

In reply to Jingoo Han

The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.

---
 drivers/net/ethernet/toshiba/spider_net.c |    1 -
 1 file changed, 1 deletion(-)
drivers/net/ethernet/toshiba/spider_net.c +0 -1
index 5734480..3f4a32e 100644
@@ -2478,7 +2478,6 @@ out_release_regions:
 	pci_release_regions(pdev);
 out_disable_dev:
 	pci_disable_device(pdev);
-	pci_set_drvdata(pdev, NULL);
 	return NULL;
 }
 
Signature · 1 line
1.7.10.4
author
#70 lore raw

PATCH 51/52 net: tc35815: remove unnecessary pci_set_drvdata()

In reply to Jingoo Han

The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.

---
 drivers/net/ethernet/toshiba/tc35815.c |    1 -
 1 file changed, 1 deletion(-)
drivers/net/ethernet/toshiba/tc35815.c +0 -1
index a971b9c..1322546 100644
@@ -887,7 +887,6 @@ static void tc35815_remove_one(struct pci_dev *pdev)
 	mdiobus_free(lp->mii_bus);
 	unregister_netdev(dev);
 	free_netdev(dev);
-	pci_set_drvdata(pdev, NULL);
 }
 
 static int
Signature · 1 line
1.7.10.4
author
#71 lore raw

PATCH 52/52 net: via-rhine: remove unnecessary pci_set_drvdata()

In reply to Jingoo Han

The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.

---
 drivers/net/ethernet/via/via-rhine.c |    1 -
 1 file changed, 1 deletion(-)
drivers/net/ethernet/via/via-rhine.c +0 -1
index c8f088a..7711374 100644
@@ -2287,7 +2287,6 @@ static void rhine_remove_one(struct pci_dev *pdev)
 
 	free_netdev(dev);
 	pci_disable_device(pdev);
-	pci_set_drvdata(pdev, NULL);
 }
 
 static void rhine_shutdown (struct pci_dev *pdev)
Signature · 1 line
1.7.10.4