All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: Al Viro <viro@ftp.linux.org.uk>
Cc: Laurent Riffard <laurent.riffard@free.fr>,
	linux-kernel@vger.kernel.org, dmo@osdl.org, mike.miller@hp.com,
	iss_storagedev@hp.com, Jeff Garzik <garzik@pobox.com>,
	Linus Torvalds <torvalds@osdl.org>
Subject: Re: [patch] drivers/block: updates .owner field of struct pci_driver
Date: Tue, 25 Oct 2005 13:17:56 -0700	[thread overview]
Message-ID: <20051025201756.GD24005@kroah.com> (raw)
In-Reply-To: <20051023214611.GH7992@ftp.linux.org.uk>

On Sun, Oct 23, 2005 at 10:46:11PM +0100, Al Viro wrote:
> On Sun, Oct 23, 2005 at 10:13:20PM +0100, Russell King wrote:
> > On Sun, Oct 23, 2005 at 10:49:48PM +0200, Laurent Riffard wrote:
> > > This patch updates .owner field of struct pci_driver.
> > > 
> > > This allows SYSFS to create the symlink from the driver to the
> > > module which provides it.
> > > 
> > > Signed-off-by: Laurent Riffard <laurent.riffard@free.fr>
> > 
> > Wouldn't it be better to eliminate pci_driver's .owner field and
> > set the generic device driver's owner field directly? (and fix
> > the PCI code not to overwrite that if pci_driver's .owner field
> > is NULL for compatibility.)
> > 
> > I ask for the second time recently on linux-kernel.  Is there
> > *really* any point in duplicating these fields?
> 
> #define pci_register_driver(d) __pci_register_driver(d, THIS_MODULE)
> 
> #define ide_pci_register_driver(d) __ide_pci_register_driver(d, THIS_MODULE)
> 
> __pci_register_driver(drv, module) - same as current pci_register_driver(),
> except that instead of
>         drv->driver.owner = drv->owner;
> it does
>         drv->driver.owner = module;
> 
> __ide_pci_register_driver(driver, module):
> {
>         if(!pre_init)
>                 return __pci_register_driver(driver, module);
> 	driver->driver.owner = module;
>         list_add_tail(&driver->node, &ide_pci_drivers);
>         return 0;
> }
> 
> and in ide_scan_pcibus() turn
>                 pci_register_driver(d);
> into
> 		__pci_register_driver(d, d->driver.owner);
> 
> Update exports (i.e. export __pci_register_driver and __ide_pci_register_driver
> instead of pci_register_driver and ide_pci_register_driver resp.).
> 
> At which point pci_driver->owner become unused and can be killed at leisure.
> Objections?

No objections at all, that's a great way to handle this.

thanks,

greg k-h

  reply	other threads:[~2005-10-25 20:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20051023204947.430464000@antares.localdomain>
2005-10-23 20:49 ` [patch] drivers/block: updates .owner field of struct pci_driver Laurent Riffard
2005-10-23 21:13   ` Russell King
2005-10-23 21:46     ` Al Viro
2005-10-25 20:17       ` Greg KH [this message]
2005-10-23 22:29     ` 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=20051025201756.GD24005@kroah.com \
    --to=greg@kroah.com \
    --cc=dmo@osdl.org \
    --cc=garzik@pobox.com \
    --cc=iss_storagedev@hp.com \
    --cc=laurent.riffard@free.fr \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mike.miller@hp.com \
    --cc=torvalds@osdl.org \
    --cc=viro@ftp.linux.org.uk \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.