Skip to contentSkip to conversation

net: hippi: remove unnecessary pci_set_drvdata()

PATCH In review Jingoo Han 3 participants 11 messages Dec 10, 2013 – Dec 11, 2013

Subsystems (7)
lore
Share & tools
lore

Jingoo Han

author
#0 lore raw

PATCH 1/7 net: hippi: 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/hippi/rrunner.c |    5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/net/hippi/rrunner.c +1 -4
index 00ed751..cd85f24 100644
@@ -213,10 +213,8 @@ static int rr_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 				    rrpriv->tx_ring_dma);
 	if (rrpriv->regs)
 		pci_iounmap(pdev, rrpriv->regs);
-	if (pdev) {
+	if (pdev)
 		pci_release_regions(pdev);
-		pci_set_drvdata(pdev, NULL);
-	}
  out2:
 	free_netdev(dev);
  out3:
@@ -244,7 +242,6 @@ static void rr_remove_one(struct pci_dev *pdev)
 	pci_iounmap(pdev, rr->regs);
 	pci_release_regions(pdev);
 	pci_disable_device(pdev);
-	pci_set_drvdata(pdev, NULL);
 	free_netdev(dev);
 }
 
Signature · 1 line
1.7.10.4
author
#1 lore raw

PATCH 2/7 net: fddi: 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/fddi/skfp/skfddi.c |    1 -
 1 file changed, 1 deletion(-)
drivers/net/fddi/skfp/skfddi.c +0 -1
index 713d303..d5f5812 100644
@@ -351,7 +351,6 @@ static void skfp_remove_one(struct pci_dev *pdev)
 	free_netdev(p);
 
 	pci_disable_device(pdev);
-	pci_set_drvdata(pdev, NULL);
 }
 
 /*
Signature · 1 line
1.7.10.4
author
#2 lore raw

PATCH 3/7 net: vmxnet3: 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/vmxnet3/vmxnet3_drv.c |    1 -
 1 file changed, 1 deletion(-)
drivers/net/vmxnet3/vmxnet3_drv.c +0 -1
index 7e2788c..a300a18 100644
@@ -3132,7 +3132,6 @@ err_alloc_queue_desc:
 err_alloc_shared:
 	dma_unmap_single(&adapter->pdev->dev, adapter->adapter_pa,
 			 sizeof(struct vmxnet3_adapter), PCI_DMA_TODEVICE);
-	pci_set_drvdata(pdev, NULL);
 	free_netdev(netdev);
 	return err;
 }
Signature · 1 line
1.7.10.4
author Acked-by Dmitry Torokhov
#4 lore raw

Re: [PATCH 3/7] net: vmxnet3: remove unnecessary pci_set_drvdata()

Quoted 8 lines · Shreyas Bhatewara
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.

(+cc Dmitry Torokhov)

Hi Shreyas Bhatewara,

It may be 'Acked-by' instead of 'Signed-off-by', right?

Also, I missed 'Acked-by' from Dmitry Torokhov.

So, Dmitry Torokhov's 'Acked-by' should be added,
when this commit is merged.

Thank you for your feedback. :-)

Best regards,
Jingoo Han

author
#5 lore raw

PATCH 4/7 net: phy: spi_ks8995: remove unnecessary spi_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/phy/spi_ks8995.c |    2 --
 1 file changed, 2 deletions(-)
drivers/net/phy/spi_ks8995.c +0 -2
index f3bea13..98fb9f3 100644
@@ -325,7 +325,6 @@ static int ks8995_probe(struct spi_device *spi)
 	return 0;
 
 err_drvdata:
-	spi_set_drvdata(spi, NULL);
 	kfree(ks);
 	return err;
 }
@@ -337,7 +336,6 @@ static int ks8995_remove(struct spi_device *spi)
 	ks8995 = spi_get_drvdata(spi);
 	sysfs_remove_bin_file(&spi->dev.kobj, &ks8995_registers_attr);
 
-	spi_set_drvdata(spi, NULL);
 	kfree(ks8995);
 
 	return 0;
Signature · 1 line
1.7.10.4
author
#6 lore raw

PATCH 5/7 net: ieee802154: remove unnecessary spi_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/ieee802154/at86rf230.c |    2 --
 drivers/net/ieee802154/mrf24j40.c  |    1 -
 2 files changed, 3 deletions(-)
drivers/net/ieee802154/at86rf230.c +0 -2
index 2cbe1c2..ab31544 100644
@@ -987,7 +987,6 @@ err_gpio_dir:
 err_slp_tr:
 	gpio_free(lp->rstn);
 err_rstn:
-	spi_set_drvdata(spi, NULL);
 	mutex_destroy(&lp->bmux);
 	ieee802154_free_device(lp->dev);
 	return rc;
@@ -1006,7 +1005,6 @@ static int at86rf230_remove(struct spi_device *spi)
 		gpio_free(lp->slp_tr);
 	gpio_free(lp->rstn);
 
-	spi_set_drvdata(spi, NULL);
 	mutex_destroy(&lp->bmux);
 	ieee802154_free_device(lp->dev);
 
drivers/net/ieee802154/mrf24j40.c +0 -1
index c6e46d6..246befa 100644
@@ -715,7 +715,6 @@ static int mrf24j40_remove(struct spi_device *spi)
 	 * complete? */
 
 	/* Clean up the SPI stuff. */
-	spi_set_drvdata(spi, NULL);
 	kfree(devrec->buf);
 	kfree(devrec);
 	return 0;
Signature · 1 line
1.7.10.4
author
#7 lore raw

PATCH 6/7 atm: he: 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/atm/he.c |    1 -
 1 file changed, 1 deletion(-)
drivers/atm/he.c +0 -1
index 8557adc..aa6be26 100644
@@ -419,7 +419,6 @@ static void he_remove_one(struct pci_dev *pci_dev)
 	atm_dev_deregister(atm_dev);
 	kfree(he_dev);
 
-	pci_set_drvdata(pci_dev, NULL);
 	pci_disable_device(pci_dev);
 }
 
Signature · 1 line
1.7.10.4
author
#8 lore raw

PATCH 7/7 atm: solos-pci: 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/atm/solos-pci.c |    2 --
 1 file changed, 2 deletions(-)
drivers/atm/solos-pci.c +0 -2
index 32784d1..e3fb496 100644
@@ -1335,7 +1335,6 @@ static int fpga_probe(struct pci_dev *dev, const struct pci_device_id *id)
 	
  out_unmap_both:
 	kfree(card->dma_bounce);
-	pci_set_drvdata(dev, NULL);
 	pci_iounmap(dev, card->buffers);
  out_unmap_config:
 	pci_iounmap(dev, card->config_regs);
@@ -1457,7 +1456,6 @@ static void fpga_remove(struct pci_dev *dev)
 	pci_release_regions(dev);
 	pci_disable_device(dev);
 
-	pci_set_drvdata(dev, NULL);
 	kfree(card);
 }
 
Signature · 1 line
1.7.10.4
maintainer
#9 lore raw
In reply to Jingoo Han

All 7 patches applied, thanks.

Please post future patch series with a proper "[PATCH 0/N] " cover email so that I can apply to just that one to let you know I've applied the other series.

If you don't provide a cover letter I'm left with only two very undesirable options. Either I reply to every patch, which is unnecessary noise, or I reply to just the first patch which people might miss.

author
#10 lore raw
Quoted 11 lines · David Miller

All 7 patches applied, thanks.

Please post future patch series with a proper "[PATCH 0/N] " cover email so that I can apply to just that one to let you know I've applied the other series.

If you don't provide a cover letter I'm left with only two very undesirable options. Either I reply to every patch, which is unnecessary noise, or I reply to just the first patch which people might miss.

OK, I see.
Thank you for your guidance.

Best regards,
Jingoo Han