From: "Adam J. Richter" <adam@yggdrasil.com>
To: torvalds@transmeta.com
Cc: linux-kernel@vger.kernel.org
Subject: PATCH(2.5.48): Eliminate pcidev.driver_data
Date: Tue, 19 Nov 2002 21:16:26 -0800 [thread overview]
Message-ID: <20021119211626.A2389@baldur.yggdrasil.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1487 bytes --]
The following patch eliminates pcidev.driver_data, in favor of
pcidev.dev.driver_data, thereby shrinking pcidev by four bytes.
In the future, I hope this patch will make it simpler to have
a facility where drivers can ask the generic device layer to do the
kmalloc of their private memory area, but that's another patch.
Applying this patch now will help discourage anyone from
building drivers that rely on having two different private pointers
in struct pci_dev and struct device.
I oringally posted this patch against 2.5.44 along with a
separate patch that changed the few device drivers that directly
referenced pcidev.dev to use pci_{get,set}_drvdata(). The latter
patches got into 2.5.45 via Jeff Garzik. At 2.5.45, I reposted this
patch and Greg Kroah-Hartman said that he would submit it to you in
"the next round of pci cleanups I'm going to be sending to Linus", but
it seems to have fallen through the cracks since then. This patch has
been posted to lkml twice before and nobody has stated any objections
to this patch.
Although I do not make much use of 2.5.48 due to the modules
problems, I have been running with this patch since 2.5.44 with no
problems.
Please apply. Thanks in advance.
--
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: pci.diff --]
[-- Type: text/plain, Size: 802 bytes --]
--- linux-2.5.48/include/linux/pci.h 2002-11-17 20:29:45.000000000 -0800
+++ linux/include/linux/pci.h 2002-11-19 21:13:04.000000000 -0800
@@ -344,7 +344,6 @@
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
@@ -770,12 +769,12 @@
*/
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;
}
/*
next reply other threads:[~2002-11-20 5:09 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-11-20 5:16 Adam J. Richter [this message]
2002-11-20 5:24 ` Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20021119211626.A2389@baldur.yggdrasil.com \
--to=adam@yggdrasil.com \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@transmeta.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®