From 19652e26a6ad17bb54b3d882041ed24cf6dceaeb Mon Sep 17 00:00:00 2001 From: "Adam J. Richter" Date: Fri, 29 Nov 2002 09:18:05 -0800 Subject: [PATCH] Patch/resubmit(2.5.50): Eliminate pci_dev.driver_data To review, this patch deletes pci_dev.driver_data, using the existing pci_dev.device.driver_data field instead, thereby shrinking struct pci_dev by four bytes on 32-bit machines. The few device drivers that attempted to directly reference pci_dev.driver_data were fixed in a patch of mine that Jeff Garzik got into 2.5.45. Also, making this change should help with memory allocation improvements in the future, although that's a separate issue. --- include/linux/pci.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'include/linux') diff --git a/include/linux/pci.h b/include/linux/pci.h index 30c4a9dbc855..3226857c6269 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -344,7 +344,6 @@ struct pci_dev { u8 rom_base_reg; /* which config register controls the ROM */ struct pci_driver *driver; /* which driver has allocated this device */ - void *driver_data; /* data private to the driver */ u64 dma_mask; /* Mask of the bits of bus address this device implements. Normally this is 0xffffffff. You only need to change @@ -753,12 +752,12 @@ static inline int pci_module_init(struct pci_driver *drv) */ static inline void *pci_get_drvdata (struct pci_dev *pdev) { - return pdev->driver_data; + return pdev->dev.driver_data; } static inline void pci_set_drvdata (struct pci_dev *pdev, void *data) { - pdev->driver_data = data; + pdev->dev.driver_data = data; } /* -- cgit v1.2.3 From 412f39a58350dc99e05bd283b5c88cd378ad444b Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Fri, 29 Nov 2002 09:28:13 -0800 Subject: PCI: changed pci_?et_drvdata to use the generic driver model functions instead of accessing the data directly. --- include/linux/pci.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'include/linux') diff --git a/include/linux/pci.h b/include/linux/pci.h index 3226857c6269..a26b3fac2128 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -747,17 +747,17 @@ static inline int pci_module_init(struct pci_driver *drv) pci_resource_start((dev),(bar)) + 1)) /* Similar to the helpers above, these manipulate per-pci_dev - * driver-specific data. Currently stored as pci_dev::driver_data, - * a void pointer, but it is not present on older kernels. + * driver-specific data. They are really just a wrapper around + * the generic device structure functions of these calls. */ static inline void *pci_get_drvdata (struct pci_dev *pdev) { - return pdev->dev.driver_data; + return dev_get_drvdata(&pdev->dev); } static inline void pci_set_drvdata (struct pci_dev *pdev, void *data) { - pdev->dev.driver_data = data; + dev_set_drvdata(&pdev->dev, data); } /* -- cgit v1.2.3