linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Patch(2.5.44 and 2.4.x): 6 files referenced pci_dev.driver_data instead of pci_{g,s}et_drv_data
@ 2002-10-27  8:36 Adam J. Richter
  2002-10-27 15:06 ` Jeff Garzik
  2002-11-07 22:55 ` [Trivial Driver patch] - PC300 driver Henrique Gobbi
  0 siblings, 2 replies; 3+ messages in thread
From: Adam J. Richter @ 2002-10-27  8:36 UTC (permalink / raw)
  To: alan, andre, axboe, netwerk, jerdfelt, neilb, mikep, linux-tr,
	arjanv, henrique
  Cc: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1843 bytes --]

	Six driver in linux-2.5.44 directly reference
pci_dev.driver_data.  This patch makes them use pci_{get,set}_drv_data
instead.

	This patch is of more than just academic interest, as I intend
to submit a patch shortly for 2.5 that will eliminate
pci_dev.driver_data in favor of pci_dev.dev.driver_data.  By applying
these changes to both 2.5.44 and your 2.4 trees if you maintiain them,
it will be one less difference between 2.4 and 2.5 for you to think
about.

	I have verified that the updated drivers compile without any
warnings related to this change (one of IDE drivers has some other
warnings).  I have not otherwise tested these changes, but they should
compile to the same object code as before.

	I would appreciate it if you would apply these changes to your
respective drivers and forward the changes for your drivers to Linus.
If you would prefer that I send the changes to Linus or follow some
other course of action I can, but I think requires few of Linus's CPU
cycles when changes for a driver are emailed from that driver's
maintainer.  If I have failed to contact the appropriate maintainer,
please let me know.


Modified files				I think maintainers are...

drivers/block/umem.c			nettwerk@valinux.com
					jerdefelt@valinux.com
					neilb@cse.unsw.edu.au

drivers/ide/pci/hpt366.c		alan@lxorg.uk.uu.org.uk
drivers/ide/pci/siimage.c		andre@linux-ide.org
					axboe@suse.de

drivers/net/tokenring/3c359.c		mikep@linuxtr.net
					linux-tr@linux-tr.net

drivers/net/tulip/xircom_cb.c		arjanv@redhat.com

drivers/net/wan/pc300_drv.c		henrique@cyclades.com

-- 
Adam J. Richter     __     ______________   575 Oroville Road
adam@yggdrasil.com     \ /                  Milpitas, California 95035
+1 408 309-6081         | g g d r a s i l   United States of America
                         "Free Software For The Rest Of Us."


[-- Attachment #2: diff --]
[-- Type: text/plain, Size: 6671 bytes --]

--- linux-2.5.44/drivers/block/umem.c	2002-10-18 21:02:34.000000000 -0700
+++ linux/drivers/block/umem.c	2002-10-27 01:09:51.000000000 -0700
@@ -1039,11 +1039,11 @@
 	printk(KERN_INFO "MM%d: Window size %d bytes, IRQ %d\n", card->card_number,
 	       card->win_size, card->irq);
 
         spin_lock_init(&card->lock);
 
-	dev->driver_data = card;
+	pci_set_drvdata(dev, card);
 
 	if (pci_write_cmd != 0x0F) 	/* If not Memory Write & Invalidate */
 		pci_write_cmd = 0x07;	/* then Memory Write command */
 
 	if (pci_write_cmd & 0x08) { /* use Memory Write and Invalidate */
@@ -1098,11 +1098,11 @@
 --                              mm_pci_remove
 -----------------------------------------------------------------------------------
 */
 static void mm_pci_remove(struct pci_dev *dev)
 {
-	struct cardinfo *card = dev->driver_data;
+	struct cardinfo *card = pci_get_drvdata(dev);
 
 	tasklet_kill(&card->tasklet);
 	iounmap(card->csr_remap);
 	release_mem_region(card->csr_base, card->csr_len);
 #ifdef CONFIG_MM_MAP_MEMORY
--- linux-2.5.44/drivers/ide/pci/hpt366.c	2002-10-18 21:01:57.000000000 -0700
+++ linux/drivers/ide/pci/hpt366.c	2002-10-27 01:09:53.000000000 -0700
@@ -314,11 +314,11 @@
 	if (drive_fast & 0x80)
 		pci_write_config_byte(dev, regfast, drive_fast & ~0x80);
 #endif
 
 	reg2 = pci_bus_clock_list(speed,
-		(struct chipset_bus_clock_list_entry *) dev->driver_data);
+		(struct chipset_bus_clock_list_entry *) pci_get_drvdata(dev));
 	/*
 	 * Disable on-chip PIO FIFO/buffer
 	 *  (to avoid problems handling I/O errors later)
 	 */
 	pci_read_config_dword(dev, regtime, &reg1);
@@ -367,11 +367,11 @@
 	if (new_fast != drive_fast)
 		pci_write_config_byte(dev, regfast, new_fast);
 
 	list_conf = pci_bus_clock_list(speed, 
 				       (struct chipset_bus_clock_list_entry *)
-				       dev->driver_data);
+				       pci_get_drvdata(dev));
 
 	pci_read_config_dword(dev, drive_pci, &drive_conf);
 	list_conf = (list_conf & ~conf_mask) | (drive_conf & conf_mask);
 	
 	if (speed < XFER_MW_DMA_0) {
@@ -399,11 +399,11 @@
 	drive_fast &= ~0x07;
 	pci_write_config_byte(dev, regfast, drive_fast);
 					
 	list_conf = pci_bus_clock_list(speed,
 			(struct chipset_bus_clock_list_entry *)
-					dev->driver_data);
+					pci_get_drvdata(dev));
 	pci_read_config_dword(dev, drive_pci, &drive_conf);
 	list_conf = (list_conf & ~conf_mask) | (drive_conf & conf_mask);
 	if (speed < XFER_MW_DMA_0)
 		list_conf &= ~0x80000000; /* Disable on-chip PIO FIFO/buffer */
 	pci_write_config_dword(dev, drive_pci, list_conf);
@@ -839,11 +839,11 @@
 	 * speed that we're running at. NOTE: the internal PLL will
 	 * result in slow reads when using a 33MHz PCI clock. we also
 	 * don't like to use the PLL because it will cause glitches
 	 * on PRST/SRST when the HPT state engine gets reset.
 	 */
-	if (dev->driver_data) 
+	if (pci_get_drvdata(dev)) 
 		goto init_hpt37X_done;
 	
 	/*
 	 * adjust PLL based upon PCI clock, enable it, and wait for
 	 * stabilization.
@@ -921,11 +921,11 @@
 		default:
 			pci_set_drvdata(dev, (void *) thirty_three_base_hpt366);
 			break;
 	}
 
-	if (!dev->driver_data)
+	if (!pci_get_drvdata(dev))
 	{
 		printk(KERN_ERR "hpt366: unknown bus timing.\n");
 		return -EOPNOTSUPP;
 	}
 	return 0;
--- linux-2.5.44/drivers/ide/pci/siimage.c	2002-10-18 21:01:48.000000000 -0700
+++ linux/drivers/ide/pci/siimage.c	2002-10-27 01:09:54.000000000 -0700
@@ -28,12 +28,12 @@
 static int n_siimage_devs;
 
 static char * print_siimage_get_info (char *buf, struct pci_dev *dev, int index)
 {
 	char *p		= buf;
-	u8 mmio		= (dev->driver_data != NULL) ? 1 : 0;
-	u32 bmdma	= (mmio) ? ((u32) dev->driver_data) :
+	u8 mmio		= (pci_get_drvdata(dev) != NULL) ? 1 : 0;
+	u32 bmdma	= (mmio) ? ((u32) pci_get_drvdata(dev)) :
 				    (pci_resource_start(dev, 4));
 
 	p += sprintf(p, "\nController: %d\n", index);
 	p += sprintf(p, "SiI%x Chipset.\n", dev->device);
 	if (mmio)
@@ -767,18 +767,18 @@
 
 	hwif->rqsize = 128;
 	if ((dev->device == PCI_DEVICE_ID_SII_3112) && (!(class_rev)))
 		hwif->rqsize = 16;
 
-	if (dev->driver_data == NULL)
+	if (pci_get_drvdata(dev) == NULL)
 		return;
 	init_mmio_iops_siimage(hwif);
 }
 
 static unsigned int __init ata66_siimage (ide_hwif_t *hwif)
 {
-	if (hwif->pci_dev->driver_data == NULL) {
+	if (pci_get_drvdata(hwif->pci_dev) == NULL) {
 		u8 ata66 = 0;
 		pci_read_config_byte(hwif->pci_dev, SELREG(0), &ata66);
 		return (ata66 & 0x01) ? 1 : 0;
 	}
 #ifndef CONFIG_TRY_MMIO_SIIMAGE
--- linux-2.5.44/drivers/net/tokenring/3c359.c	2002-10-18 21:02:34.000000000 -0700
+++ linux/drivers/net/tokenring/3c359.c	2002-10-27 01:09:55.000000000 -0700
@@ -1778,11 +1778,11 @@
 	return 0 ; 
 }
 
 static void __devexit xl_remove_one (struct pci_dev *pdev)
 {
-	struct net_device *dev = pdev->driver_data;
+	struct net_device *dev = pci_get_drvdata(pdev);
 	struct xl_private *xl_priv=(struct xl_private *)dev->priv;
 	
 	unregister_trdev(dev);
 	iounmap(xl_priv->xl_mmio) ; 
 	pci_release_regions(pdev) ; 
--- linux-2.5.44/drivers/net/tulip/xircom_cb.c	2002-10-18 21:02:28.000000000 -0700
+++ linux/drivers/net/tulip/xircom_cb.c	2002-10-27 01:09:56.000000000 -0700
@@ -297,11 +297,11 @@
 	dev->hard_start_xmit = &xircom_start_xmit;
 	dev->stop = &xircom_close;
 	dev->get_stats = &xircom_get_stats;
 	dev->priv = private;
 	dev->do_ioctl = &private_ioctl;
-	pdev->driver_data = dev;
+	pci_set_drvdata(pdev, dev);
 
 	
 	/* start the transmitter to get a heartbeat */
 	/* TODO: send 2 dummy packets here */
 	tranceiver_voodoo(private);
@@ -324,11 +324,11 @@
  Interrupts and such are already stopped in the "ifconfig ethX down"
  code.
  */
 static void __devexit xircom_remove(struct pci_dev *pdev)
 {
-	struct net_device *dev = pdev->driver_data;
+	struct net_device *dev = pci_get_drvdata(pdev);
 	struct xircom_private *card;
 	enter("xircom_remove");
 	if (dev!=NULL) {
 		card=dev->priv;
 		if (card!=NULL) {	
--- linux-2.5.44/drivers/net/wan/pc300_drv.c	2002-10-18 21:02:32.000000000 -0700
+++ linux/drivers/net/wan/pc300_drv.c	2002-10-27 01:09:57.000000000 -0700
@@ -3554,11 +3554,11 @@
 	       card->hw.rambase, card->hw.plxbase, card->hw.scabase,
 	       card->hw.falcbase);
 #endif
 
 	/* Set PCI drv pointer to the card structure */
-	pdev->driver_data = card;
+	pci_set_drvdata(pdev, card);
 
 	/* Set board type */
 	switch (device_id) {
 		case PCI_DEVICE_ID_PC300_TE_1:
 		case PCI_DEVICE_ID_PC300_TE_2:
@@ -3629,11 +3629,11 @@
 	return -ENODEV;
 }
 
 static void __devexit cpc_remove_one(struct pci_dev *pdev)
 {
-	pc300_t *card = (pc300_t *) pdev->driver_data;
+	pc300_t *card = pci_get_drvdata(pdev);
 
 	if (card->hw.rambase != 0) {
 		int i;
 
 		/* Disable interrupts on the PCI bridge */

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Patch(2.5.44 and 2.4.x): 6 files referenced pci_dev.driver_data instead of pci_{g,s}et_drv_data
  2002-10-27  8:36 Patch(2.5.44 and 2.4.x): 6 files referenced pci_dev.driver_data instead of pci_{g,s}et_drv_data Adam J. Richter
@ 2002-10-27 15:06 ` Jeff Garzik
  2002-11-07 22:55 ` [Trivial Driver patch] - PC300 driver Henrique Gobbi
  1 sibling, 0 replies; 3+ messages in thread
From: Jeff Garzik @ 2002-10-27 15:06 UTC (permalink / raw)
  To: Adam J. Richter
  Cc: alan, andre, axboe, netwerk, jerdfelt, neilb, mikep, linux-tr,
	arjanv, henrique, linux-kernel

Patch looks good to me.  I'll queue for Linus unless someone else has 
already done so.

could you be talked into doing a similar patch for 2.4.x?



^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Trivial Driver patch] - PC300 driver
  2002-10-27  8:36 Patch(2.5.44 and 2.4.x): 6 files referenced pci_dev.driver_data instead of pci_{g,s}et_drv_data Adam J. Richter
  2002-10-27 15:06 ` Jeff Garzik
@ 2002-11-07 22:55 ` Henrique Gobbi
  1 sibling, 0 replies; 3+ messages in thread
From: Henrique Gobbi @ 2002-11-07 22:55 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel

Hello,

Please include this patch to the linux-2.5.46/drivers/net/wan/pc300_drv.c
file. It includes the MODULE_xxx macros.

thanks in advance
Henrique


--- linux-2.5.46/drivers/net/wan/pc300_drv.c.old     Thu Nov  7 22:42:12
2002
+++ linux-2.5.46/drivers/net/wan/pc300_drv.c   Thu Nov  7 22:42:19 2002
@@ -3687,3 +3687,9 @@

 module_init(cpc_init);
 module_exit(cpc_cleanup_module);
+
+MODULE_DESCRIPTION("Cyclades-PC300 cards driver");
+MODULE_AUTHOR(  "Author: Ivan Passos <ivan@cyclades.com>\r\n"
+                "Maintainer: Henrique Gobbi <henrique.gobbi@cyclades.com");
+MODULE_LICENSE("GPL");
+



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-11-07 22:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-10-27  8:36 Patch(2.5.44 and 2.4.x): 6 files referenced pci_dev.driver_data instead of pci_{g,s}et_drv_data Adam J. Richter
2002-10-27 15:06 ` Jeff Garzik
2002-11-07 22:55 ` [Trivial Driver patch] - PC300 driver Henrique Gobbi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).