From: "Jon Smirl" <jonsmirl@gmail.com>
To: "Matthew Wilcox" <matthew@wil.cx>
Cc: "Greg KH" <gregkh@suse.de>, "Jeff Garzik" <jgarzik@pobox.com>,
"Greg KH" <greg@kroah.com>, "Jiri Slaby" <jirislaby@gmail.com>,
"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
linux-pci@atrey.karlin.mff.cuni.cz
Subject: Re: searching for pci busses
Date: Tue, 30 May 2006 13:19:23 -0400 [thread overview]
Message-ID: <9e4733910605301019x30cb41eby2ac54b8b48856179@mail.gmail.com> (raw)
In-Reply-To: <20060530170051.GA1610@parisc-linux.org>
[-- Attachment #1: Type: text/plain, Size: 1423 bytes --]
On 5/30/06, Matthew Wilcox <matthew@wil.cx> wrote:
> On Tue, May 30, 2006 at 12:52:31PM -0400, Jon Smirl wrote:
> > This is how DRM does it...
>
> > for (i = 0; driver->pci_driver.id_table[i].vendor != 0; i++) {
> > pid = (struct pci_device_id *)&driver->pci_driver.id_table[i];
>
> Why do you cast away the const warning? Why not just make pid a pointer
> to const? drm_get_dev already has the const qualifier, so somebody
> realised what the right thing to do was.
Nobody pointed that out before (That code has been around for a while,
I suspect one of the routines being called wasn't always marked as
taking a const parameter). I made a patch and attached it. You can
send it to DaveA, they reject everything from me.
> But looking at this code just reinforces the basic problem -- that DRM
> does everything wrong and it needs shooting in the head.
DRM has to do that loop because the fbdev drivers are already bound to
the device. There is a more complex version in DRM CVS that looks for
the fbdev drivers, if they are not present DRM will bind to the
device, otherwise it falls back in stealth mode. It also adds code to
manually mark PCI memory regions in use. Confusion over who can bind
has impacts on attaching to the suspend/resume hooks.
But binding is only a minor problem. The true problem is who controls
the state loaded inside of the device.
--
Jon Smirl
jonsmirl@gmail.com
[-- Attachment #2: drm.patch --]
[-- Type: text/x-patch, Size: 752 bytes --]
diff --git a/drivers/char/drm/drm_drv.c b/drivers/char/drm/drm_drv.c
index 3c0b882..3af48be 100644
--- a/drivers/char/drm/drm_drv.c
+++ b/drivers/char/drm/drm_drv.c
@@ -253,7 +253,7 @@ int drm_lastclose(drm_device_t * dev)
int drm_init(struct drm_driver *driver)
{
struct pci_dev *pdev = NULL;
- struct pci_device_id *pid;
+ const struct pci_device_id *pid;
int i;
DRM_DEBUG("\n");
@@ -261,7 +261,7 @@ int drm_init(struct drm_driver *driver)
drm_mem_init();
for (i = 0; driver->pci_driver.id_table[i].vendor != 0; i++) {
- pid = (struct pci_device_id *)&driver->pci_driver.id_table[i];
+ pid = &driver->pci_driver.id_table[i];
pdev = NULL;
/* pass back in pdev to account for multiple identical cards */
next prev parent reply other threads:[~2006-05-30 17:19 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-27 23:13 Jiri Slaby
2006-05-29 21:47 ` Greg KH
2006-05-29 21:59 ` Jeff Garzik
2006-05-30 16:38 ` Greg KH
2006-05-30 16:52 ` Jon Smirl
2006-05-30 16:58 ` Greg KH
2006-05-30 17:00 ` Matthew Wilcox
2006-05-30 17:19 ` Jon Smirl [this message]
2006-05-30 17:02 ` Jiri Slaby
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=9e4733910605301019x30cb41eby2ac54b8b48856179@mail.gmail.com \
--to=jonsmirl@gmail.com \
--cc=greg@kroah.com \
--cc=gregkh@suse.de \
--cc=jgarzik@pobox.com \
--cc=jirislaby@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@atrey.karlin.mff.cuni.cz \
--cc=matthew@wil.cx \
/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®