Patch/resubmit(2.5.50): Eliminate pci_dev.driver_data

Patch/resubmit(2.5.50): Eliminate pci_dev.driver_data

Post by Adam J. Richte » Sun, 01 Dec 2002 03:50:06




>Can we please get this integrated
>already?  I want to try some more changes to pci.h and I'd rather keep
>the patches separate.

        Grr.  I already have one overlapping patch that I forgot
to remove from that diff.  Here is a corrected patch.  It will
be offset by one line when you apply it.

Adam J. Richter     __     ______________   575 Oroville Road

+1 408 309-6081         | g g d r a s i l   United States of America
                         "Free Software For The Rest Of Us."

--- linux-2.5.50/include/linux/pci.h    2002-11-27 14:35:59.000000000 -0800

        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

  */
 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;
 }

 /*
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

Patch/resubmit(2.5.50): Eliminate pci_dev.driver_data

Post by Adam J. Richte » Sun, 01 Dec 2002 03:50:05


        This is the third time I'm posting this patch.  The only
comments anyone has made about it were from Greg Kroah-Hartmann, which
were in favor of integrating it.  Can we please get this integrated
already?  I want to try some more changes to pci.h and I'd rather keep
the patches separate.

        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.

--
Adam J. Richter     __     ______________   575 Oroville Road

+1 408 309-6081         | g g d r a s i l   United States of America
                         "Free Software For The Rest Of Us."

  pci.diff
1K Download

 
 
 

Patch/resubmit(2.5.50): Eliminate pci_dev.driver_data

Post by Greg K » Sun, 01 Dec 2002 11:20:05



>    This is the third time I'm posting this patch.  The only
> comments anyone has made about it were from Greg Kroah-Hartmann, which
> were in favor of integrating it.  Can we please get this integrated
> already?  I want to try some more changes to pci.h and I'd rather keep
> the patches separate.

Sorry for the long delay, been working on other things...

I've finally added this to my trees, and will be sending it on to Linus.

thanks for your patience.

greg k-h
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

1. Patch/resubmit: 2.5.45 - eliminate pci_dev.driver_data

Hi Martin,

        The following patch eliminates pci_dev.driver_data, in favor
of the field provided for this purpose in the generic struct device
(pci_dev.dev.driver_data).  This shinks pci_dev by four bytes and
eliminates a line from pci.h.

        What gives this patch importance to me is that I am about to
submit a patch for the generic driver layer to do simple
pre-allocation of device.driver_data for drivers that request it
(current code will be unaffected).  This will enable elimination of of
some memory allocation/deallocation pairs and associated error legs in
many drivers.

        I submitted this patch to you during 2.5.44 and mentioned that
there were a few driver files that still directly referenced
pci_dev.driver_data and that I had submitted patches to fix them to
use pci_[gs]et_drvdata.  Those patches got into 2.5.45, so integrating
this patch at this point should not break any drivers.

        I have been running this change in 2.5.44 and 2.5.45 without
problems.

        Also, I would appreciate it if you would acknowledge this
email.  Thanks in advance.

--
Adam J. Richter     __     ______________   575 Oroville Road

+1 408 309-6081         | g g d r a s i l   United States of America
                         "Free Software For The Rest Of Us."

  pci.diff
< 1K Download

2. error during kernal compiling..

3. Patch/resubmit(2.5.50): Use struct io_restrictions in blkdev.h

4. Stats comp.os.linux.networking (last 7 days)

5. Patch: linux-2.5.44/include/linux/pci.h - eliminate pci_dev.driver_data

6. IP Masqing/ipautofw

7. 2.5.50 mpu401.h compilation error patches

8. Echo in telnet mode -- How to turn it off?

9. [0/4] patch series vs. 2.5.50-mm1

10. module loading 2.5.50 + nvidia patch

11. 2.5.50 conglomerate module fixes patch

12. PATCH(2.5.48): Eliminate pcidev.driver_data

13. 2.5.50 responsiveness