RE: Forward porting of the USB Driver Controller from 2.6.34.10 to 3.2.11

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

 



> > Some pointer went dangling around (with address udc_driver), probably!?
>
> It looks like your UDC's probe routine forgot to call
> device_register(&gadget->dev) before passing the gadget structure to usb_add_gadget_udc().
>
> Can you post the source to your probe routine?
>
> Alan Stern

Experience speaks for itself! U R right. But it is not the only trouble this code has.

I can now register the gadget driver (g_zero for example), but could not unregister (it is crashing)!

In other words, modprobe works without problems, rmmod crashes. Here is the max_udc_remove() code:
_______

/**
* max_udc_remove - removes the udc device driver                                                                                                                                                                                   
 * @_dev: platform device                                                                                                                                                                                                           
 */
static int __exit max_udc_remove(struct platform_device *_dev)
{
        struct max_udc *udc = platform_get_drvdata(_dev);

        usb_del_gadget_udc(&udc->gadget);

        BUG_ON(udc->driver);

        udc_disable(udc);

        usb_gadget_unregister_driver(udc->driver);

#if CONFIG_MAX_IRQ_SUPPORT
        free_irq(udc->irq, udc);
#endif

        max_cleanup_debugfs(udc);

        if (udc->spibar)
                iounmap(udc->spibar);

        platform_set_drvdata(_dev, NULL);

        dev_info (udc->dev, "unbind\n");

        return 0;
}

I dug much deeper (making analogy with net2280 UDC), and I am not sure that what we have for now is entirely correct.

Let me try to think if I need to rewrite some of the things/interfaces...

I very much appreciate your help.

Thank you!
Zoran

--------------------------------------------------------------------------------------
Intel GmbH
Dornacher Strasse 1
85622 Feldkirchen/Muenchen, Deutschland 
Sitz der Gesellschaft: Feldkirchen bei Muenchen
Geschaeftsfuehrer: Douglas Lusk, Peter Gleissner, Hannes Schwaderer
Registergericht: Muenchen HRB 47456 
Ust.-IdNr./VAT Registration No.: DE129385895
Citibank Frankfurt a.M. (BLZ 502 109 00) 600119052

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux