aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2011-10-24 01:55:54 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2011-11-14 14:51:21 -0500
commit7fccd480b7fe84a98ee252fa79dd92f7fff5ec2a (patch)
treed2cde25dd1f064a7c4facbbeb62c80246e263717 /drivers
parent0e042be348b864a57a8a452aaa7ec49be5fb9e59 (diff)
usb: gadget: renesas_usbhs: fixup struct completion usage
Since renesas_usbhs mod_host didn't use struct completion as static object, the warning of lockdep came out. This patch fixup this issue. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/renesas_usbhs/mod_host.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/drivers/usb/renesas_usbhs/mod_host.c b/drivers/usb/renesas_usbhs/mod_host.c
index 1a7208a50afc..9b8886867f4a 100644
--- a/drivers/usb/renesas_usbhs/mod_host.c
+++ b/drivers/usb/renesas_usbhs/mod_host.c
@@ -103,7 +103,7 @@ struct usbhsh_hpriv {
103 103
104 u32 port_stat; /* USB_PORT_STAT_xxx */ 104 u32 port_stat; /* USB_PORT_STAT_xxx */
105 105
106 struct completion *done; 106 struct completion setup_ack_done;
107 107
108 /* see usbhsh_req_alloc/free */ 108 /* see usbhsh_req_alloc/free */
109 struct list_head ureq_link_active; 109 struct list_head ureq_link_active;
@@ -549,8 +549,7 @@ static void usbhsh_setup_stage_packet_push(struct usbhsh_hpriv *hpriv,
549 * usbhsh_irq_setup_ack() 549 * usbhsh_irq_setup_ack()
550 * usbhsh_irq_setup_err() 550 * usbhsh_irq_setup_err()
551 */ 551 */
552 DECLARE_COMPLETION(done); 552 init_completion(&hpriv->setup_ack_done);
553 hpriv->done = &done;
554 553
555 /* copy original request */ 554 /* copy original request */
556 memcpy(&req, urb->setup_packet, sizeof(struct usb_ctrlrequest)); 555 memcpy(&req, urb->setup_packet, sizeof(struct usb_ctrlrequest));
@@ -572,8 +571,7 @@ static void usbhsh_setup_stage_packet_push(struct usbhsh_hpriv *hpriv,
572 /* 571 /*
573 * wait setup packet ACK 572 * wait setup packet ACK
574 */ 573 */
575 wait_for_completion(&done); 574 wait_for_completion(&hpriv->setup_ack_done);
576 hpriv->done = NULL;
577 575
578 dev_dbg(dev, "%s done\n", __func__); 576 dev_dbg(dev, "%s done\n", __func__);
579} 577}
@@ -1095,10 +1093,7 @@ static int usbhsh_irq_setup_ack(struct usbhs_priv *priv,
1095 1093
1096 dev_dbg(dev, "setup packet OK\n"); 1094 dev_dbg(dev, "setup packet OK\n");
1097 1095
1098 if (unlikely(!hpriv->done)) 1096 complete(&hpriv->setup_ack_done); /* see usbhsh_urb_enqueue() */
1099 dev_err(dev, "setup ack happen without necessary data\n");
1100 else
1101 complete(hpriv->done); /* see usbhsh_urb_enqueue() */
1102 1097
1103 return 0; 1098 return 0;
1104} 1099}
@@ -1111,10 +1106,7 @@ static int usbhsh_irq_setup_err(struct usbhs_priv *priv,
1111 1106
1112 dev_dbg(dev, "setup packet Err\n"); 1107 dev_dbg(dev, "setup packet Err\n");
1113 1108
1114 if (unlikely(!hpriv->done)) 1109 complete(&hpriv->setup_ack_done); /* see usbhsh_urb_enqueue() */
1115 dev_err(dev, "setup err happen without necessary data\n");
1116 else
1117 complete(hpriv->done); /* see usbhsh_urb_enqueue() */
1118 1110
1119 return 0; 1111 return 0;
1120} 1112}
@@ -1279,7 +1271,6 @@ int __devinit usbhs_mod_host_probe(struct usbhs_priv *priv)
1279 hpriv->mod.stop = usbhsh_stop; 1271 hpriv->mod.stop = usbhsh_stop;
1280 hpriv->pipe_info = pipe_info; 1272 hpriv->pipe_info = pipe_info;
1281 hpriv->pipe_size = pipe_size; 1273 hpriv->pipe_size = pipe_size;
1282 hpriv->done = NULL;
1283 usbhsh_req_list_init(hpriv); 1274 usbhsh_req_list_init(hpriv);
1284 usbhsh_port_stat_init(hpriv); 1275 usbhsh_port_stat_init(hpriv);
1285 1276