public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Al Viro <viro@ftp.linux.org.uk>
To: Laurent Riffard <laurent.riffard@free.fr>,
	Greg KH <greg@kroah.com>,
	linux-kernel@vger.kernel.org, dmo@osdl.org, mike.miller@hp.com,
	iss_storagedev@hp.com, Jeff Garzik <garzik@pobox.com>
Cc: Linus Torvalds <torvalds@osdl.org>
Subject: Re: [patch] drivers/block: updates .owner field of struct pci_driver
Date: Sun, 23 Oct 2005 22:46:11 +0100	[thread overview]
Message-ID: <20051023214611.GH7992@ftp.linux.org.uk> (raw)
In-Reply-To: <20051023211320.GB19915@flint.arm.linux.org.uk>

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?

  reply	other threads:[~2005-10-23 21:46 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 [this message]
2005-10-25 20:17       ` Greg KH
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=20051023214611.GH7992@ftp.linux.org.uk \
    --to=viro@ftp.linux.org.uk \
    --cc=dmo@osdl.org \
    --cc=garzik@pobox.com \
    --cc=greg@kroah.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 \
    /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