public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@suse.de>
To: Jiri Slaby <jirislaby@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>, linux-kernel@vger.kernel.org
Subject: Re: const struct pci_driver [Was: [RFC 2/2] Input: phantom, add a new driver]
Date: Fri, 20 Apr 2007 10:31:18 -0700	[thread overview]
Message-ID: <20070420173118.GA10082@suse.de> (raw)
In-Reply-To: <462879BE.1050401@gmail.com>

On Fri, Apr 20, 2007 at 10:28:46AM +0200, Jiri Slaby wrote:
> Andrew Morton napsal(a):
> > On Tue, 17 Apr 2007 22:02:10 +0200 (CEST) Jiri Slaby <jirislaby@gmail.com> wrote:
> > 
> >> phantom, add a new driver
> [...]
> >> +static struct pci_driver phantom_pci_driver = {
> >> +	.name = "phantom",
> >> +	.id_table = phantom_pci_tbl,
> >> +	.probe = phantom_probe,
> >> +	.remove = __devexit_p(phantom_remove),
> >> +	.suspend = phantom_suspend,
> >> +	.resume = phantom_resume
> >> +};
> > 
> > This goes into the read/write section.  Make it const?
> 
> Hmm, good question, I don't know the answer. Why are not pci_driver structs
> const, Greg?

Because the pci core sets the needed pci_driver.driver structure fields
that the driver core needs in order to properly hook up things.

I'm considering a change to this that would allow pci (and all other)
driver structures be const, and then dynamically create the needed
driver core structure based on this "template" which would also let us
do some other things that the driver core wants, but that work is a few
months away.  When/if I get to that, I'll go through and mark all of the
driver structures const to move them to the read-only kernel section.

thanks,

greg k-h

  reply	other threads:[~2007-04-20 17:33 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-17 20:01 [RFC 1/2] Input: ff, add FF_RAW effect Jiri Slaby
2007-04-17 20:02 ` [RFC 2/2] Input: phantom, add a new driver Jiri Slaby
2007-04-20  6:07   ` Andrew Morton
2007-04-20  8:28     ` const struct pci_driver [Was: [RFC 2/2] Input: phantom, add a new driver] Jiri Slaby
2007-04-20 17:31       ` Greg KH [this message]
2007-04-20  9:01     ` [RFC 2/2] Input: phantom, add a new driver Jiri Slaby
2007-04-18 20:00 ` [RFC 1/2] Input: ff, add FF_RAW effect johann deneux
2007-04-18 21:07   ` Jiri Slaby
2007-04-19  4:25     ` johann deneux
2007-04-19  4:58       ` Dmitry Torokhov
2007-04-19 15:38         ` Jiri Slaby
2007-04-19 16:02           ` Dmitry Torokhov
2007-04-22 12:57             ` Jiri Slaby
2007-04-26 16:02               ` Dmitry Torokhov
2007-04-26 23:24                 ` Jiri Slaby
2007-04-23 19:30             ` Jiri Slaby
2007-04-26 15:58               ` Dmitry Torokhov

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=20070420173118.GA10082@suse.de \
    --to=gregkh@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=jirislaby@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /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