• N
    usb: gadget: mv_udc: refine the driver structure · dde34cc5
    Neil Zhang 提交于
    This patch do the following things:
    
    1. Add header and Copyright for marvell usb driver.
    2. Add mv_usb.h in include/linux/platform_data, make the driver
       fits all the marvell platform using the same ChipIdea usb ip.
    3. Some SOC may has mutiple clock sources, so let me define it
       in mv_usb_platform_data and give two helper functions named
       udc_clock_enable/udc_clock_disable to deal with the clocks.
    4. Different SOCs will have some difference in PHY initialization,
       so we will remove file mv_udc_phy.c and add two funtions in
       mv_usb_platform_data, let the platform relative driver to realize it.
    5. Rewrite probe function according to the modification list above. Find
       it will kernel panic when probe failed. The root cause is as follows:
    	When probe failed, the error handle may call device_unregister()
    	which in return will call gadget_release.In current code,
    	gadget_release have two issues:
    		1: the_controller is a NULL pointer.
    		2: if we free udc here, then the following code in probe
    		   will access NULL pointer.
    Signed-off-by: NNeil Zhang <zhangwm@marvell.com>
    Signed-off-by: NFelipe Balbi <balbi@ti.com>
    dde34cc5
mv_usb.h 1.1 KB