From: Greg KH <greg@kroah.com>
To: David Brownell <david-b@pacbell.net>
Cc: linux-usb-devel@lists.sourceforge.net,
linux-kernel@vger.kernel.org, Patrick Mochel <mochel@osdl.org>
Subject: Re: [RFC] USB driver conversion to use "struct device_driver"
Date: Mon, 12 Aug 2002 09:45:21 -0700 [thread overview]
Message-ID: <20020812164521.GA15249@kroah.com> (raw)
In-Reply-To: <3D55832B.4040104@pacbell.net>
On Sat, Aug 10, 2002 at 02:18:35PM -0700, David Brownell wrote:
> Why are devices children of the hub _interface_ now? Today they're
> children of the hub device. The hub spec requires only one interface
> for all hub devices, so it's safe the way it is today. With devices
> as children of hubs devices, things look more familiar ... hubs act
> like pci bridges (which they logically resemble).
Good point, I noticed that this had changed, but haven't fixed it, I'll
make sure it goes back to the way it was before.
> Minor rough spot, please rename to usb_device_match() since it's
> the bus_type->match() callback. Might even be nice to split out
> some of the relevant code into "usb-device.c", mirroring what the
> "pci-device.c" code does but with bus-specific differences. There's
> too much random code in "usb.c" still for my taste! And all code
> at this level is usbcore-internal anyway, shouldn't be mixed with
> public driver APIs. :)
The name will be changed, it's a hold over from when the driver model
function was called "bind". And that's a good idea for a new file.
> > struct usb_driver {
> > struct module *owner;
> > const char *name;
> >+
> >+ int (*new_probe) (struct usb_interface *intf);
> >+ int (*init) (struct usb_interface *intf);
> >+ void (*new_disco) (struct usb_interface *intf);
> >+
> >+ struct device_driver driver;
> >
> > void *(*probe)(
> > struct usb_device *dev, /* the device */
>
> I don't see why this isn't done as a transparent wrapper around
> the existing probe()/disconnect() routines. PCI did this without
> any such major changes to the driver API, and I thought being able
> to do that was a (good!) device model design goal.
I think making the probe() and disconnect() functions match the driver
model makes more sense now. We have an easier time of fixing all of the
USB drivers at once, compared to the PCI driver interface, which has
_lots_ more drivers to convert.
> If we want to change the API to refocus on interfaces, rather
> than device plus whichever kind of identifying number is used in
> the relevant context, I'd rather start by getting rid of the
> APIs that have been problematic (device + number). That'd be
> nice for configurations and endpoints too, but I think most of
> those calls involve interfaces. Those changes would be a lot
> less invasive so far as device drivers are concerned.
What APIs would those be?
> Also, the generic driver model calls are probe/disconnect,
> suspend/resume, and release. Today, USB has probe/disconnect
> but not the others. I'd expect to see suspend/resume in there
> before a new init callback ... but I see the init routine is
> unused, maybe that just snuck in by accident.
Yes, the other callbacks will get added, and init() was added as part of
the old original patch, I'll remove it.
thanks for the comments,
greg k-h
next prev parent reply other threads:[~2002-08-12 16:45 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-08-10 0:10 [RFC] USB driver conversion to use "struct device_driver" Greg KH
2002-08-10 9:57 ` [linux-usb-devel] " Oliver Neukum
2002-08-10 15:40 ` Greg KH
2002-08-10 21:18 ` David Brownell
2002-08-12 16:45 ` Greg KH [this message]
2002-08-12 18:30 ` David Brownell
2002-08-12 21:30 ` Greg KH
2002-08-12 23:36 ` David Brownell
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=20020812164521.GA15249@kroah.com \
--to=greg@kroah.com \
--cc=david-b@pacbell.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb-devel@lists.sourceforge.net \
--cc=mochel@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