Re: Handling devices that don't have a bus

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Mar 30, 2006 at 03:45:50PM -0500, Alan Stern wrote:
> I recently tried running the dummy_hcd driver for the first time in a 
> while, and it crashed when the gadget driver was unloaded.  It turns out 
> this was because the gadget's embedded struct device is registered without 
> a bus, which triggers an oops when the device's driver is unbound.  The 
> oops could be fixed by doing this:

Can you provide the oops itself please?

> Part of the problem here is that most of the USB controllers are platform
> devices and so belong on the platform bus.

You're making a connection where no such connection exists.  Devices
are only part of the platform bus if they explicitly want to be (in
much the same way that devices are only part of the PCI bus if they
explicitly set dev->bus to be the PCI bus.)

> But struct usb_gadget contains an embedded struct device, not an embedded
> struct platform_device... so the gadget _can't_ be registered on its 
> parent's bus.

>From what I can see, the embedded device does not belong to any bus at
all since dev->bus is NULL.  Hence, I don't think it's the embedded
struct device which is causing the problem here.

It would be good to see the entire oops to see what's going on.

-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:  2.6 Serial core
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux