Skip to contentSkip to conversation

: -ENODEV Error!

ERROR Felipe Balbi 2 participants 2 messages Nov 6, 2006

lore
Share & tools
lore
#0 lore raw

Hello all,

I'm getting some "No such Device" messages when loading any of the g_* modules.
I was trying to hack omap_udc.c and I figured out the error is with the first "sanity test", as called in the source-code:

int usb_gadget_register_driver (struct usb_gadget_driver *driver)

{
       int             status = -ENODEV;
       struct omap_ep  *ep;
       unsigned long   flags;

       /* basic sanity tests */
       if (!udc)       <---- THIS IS GIVING ME THE ERROR... I COMMENTED 
THIS AND
               return -ENODEV;
       if (!driver 
                       // FIXME if otg, check:  driver->is_otg
                       || driver->speed < USB_SPEED_FULL
                       || !driver->bind
                       || !driver->unbind
                       || !driver->setup)    <------ THIS GAVE ME 
ANOTHER BUG!!! :-P
               return -EINVAL;

       spin_lock_irqsave(&udc->lock, flags);
       if (udc->driver) {
               spin_unlock_irqrestore(&udc->lock, flags);
               return -EBUSY;
       }

The error:

# modprobe g_serial
udc: OMAP UDC driver, version: 4 October 2004 (iso) (dma)
udc: OMAP UDC rev 6.1, Mini-AB
gs_module_init: cannot register gadget driver, ret=-19
FATAL: Error inserting g_serial (/lib/modules/2.6.19-rc4-omap1-gfb280632-dirty/kernel/drivers/usb/gadget/g_serial.ko): No such device
Signature · 5 lines
Best Regards,

Felipe Balbi
[email protected]
OSMRC - INdT
#1 lore raw
Quoted 8 lines · Felipe Balbi

int usb_gadget_register_driver (struct usb_gadget_driver *driver)

{
        int             status = -ENODEV;
        struct omap_ep  *ep;
        unsigned long   flags;

        /* basic sanity tests */
        if (!udc)       <---- THIS IS GIVING ME THE ERROR... 

Then your board setup is probably wrong, so that probe() didn't get called because there was no USB peripheral controller. Or probe() failed for some reason.

This realy _is_ a fatal error...

Quoted 8 lines
                return -ENODEV;
        if (!driver 
                        // FIXME if otg, check:  driver->is_otg
                        || driver->speed < USB_SPEED_FULL
                        || !driver->bind
                        || !driver->unbind
                        || !driver->setup)    <------ THIS GAVE ME 

ANOTHER BUG!!! :-P

Also a fatal error. Gadget drivers **MUST** handle control messages, e.g. so they will send device descriptors.

- Dave