From 451454b4e726444aaef6a4a6e7a9f75e306c2180 Mon Sep 17 00:00:00 2001 From: wlf Date: Tue, 22 Apr 2014 14:33:15 +0800 Subject: [PATCH] USB: fix otg20_hcd_connect_detect to solve clk_prepare err. --- drivers/usb/dwc_otg_310/dwc_otg_hcd_linux.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/usb/dwc_otg_310/dwc_otg_hcd_linux.c b/drivers/usb/dwc_otg_310/dwc_otg_hcd_linux.c index a0b65906890b..fdf36cc73e5b 100755 --- a/drivers/usb/dwc_otg_310/dwc_otg_hcd_linux.c +++ b/drivers/usb/dwc_otg_310/dwc_otg_hcd_linux.c @@ -415,9 +415,9 @@ static void dwc_otg_hcd_connect_detect(unsigned long pdata) return; } -static void otg20_hcd_connect_detect(unsigned long pdata) +static void otg20_hcd_connect_detect(struct work_struct *work) { - dwc_otg_hcd_t *dwc_otg_hcd = (dwc_otg_hcd_t *)pdata; + dwc_otg_hcd_t *dwc_otg_hcd = container_of(work, dwc_otg_hcd_t, host_enable_work.work); dwc_otg_core_if_t *core_if = dwc_otg_hcd->core_if; struct dwc_otg_platform_data *pldata; pldata = core_if->otg_dev->pldata; @@ -519,10 +519,8 @@ int otg20_hcd_init( struct platform_device *_dev ) dwc_otg_hcd->host_enabled = 1; if(dwc_otg_is_host_mode(otg_dev->core_if) || (otg_dev->core_if->usb_mode == USB_MODE_FORCE_HOST)){ - dwc_otg_hcd->connect_detect_timer.function = otg20_hcd_connect_detect; - dwc_otg_hcd->connect_detect_timer.data = (unsigned long)(dwc_otg_hcd); - init_timer( &dwc_otg_hcd->connect_detect_timer); - mod_timer(&dwc_otg_hcd->connect_detect_timer, jiffies+(HZ>>2)); + INIT_DELAYED_WORK(&dwc_otg_hcd->host_enable_work, otg20_hcd_connect_detect); + schedule_delayed_work(&dwc_otg_hcd->host_enable_work, HZ>>2); } return 0; -- 2.34.1