aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-08-27 17:07:31 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-08-27 17:07:31 -0400
commit752e69555d107853043cb9405250c9387b26e708 (patch)
tree5614a210da5793a05044e3683f78be7991837bee
parentf2e0ae93cc81cb56ed32722da7b7246a24940f90 (diff)
parent0f2aa8caeaa043f6cbe6281eb72efba5ff860904 (diff)
Merge tag 'usb-for-v3.12-part2' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-next
Felipe writes: usb: patches for v3.12 merge window (part 2) Here's a set of important fixes for v3.12 merge window which have been pending in the mailing list for quite some time. We have use-after-free fixes, signedness fixes, more of HAS_DMA dependencies, fixes for NULL pointer deferences, build fixes and some other fixes to the musb driver caused by recent patches. Patches are quite small and contain valuable fixes which will give us a much better -rc1 release. Please consider merging Signed-of-by: Felipe Balbi <balbi@ti.com>
-rw-r--r--Documentation/devicetree/bindings/usb/am33xx-usb.txt222
-rw-r--r--arch/arm/boot/dts/am335x-bone.dts15
-rw-r--r--arch/arm/boot/dts/am335x-evm.dts7
-rw-r--r--arch/arm/boot/dts/am335x-evmsk.dts2
-rw-r--r--arch/arm/boot/dts/am33xx.dtsi69
-rw-r--r--drivers/dma/cppi41.c13
-rw-r--r--drivers/usb/dwc3/core.c1
-rw-r--r--drivers/usb/gadget/Kconfig5
-rw-r--r--drivers/usb/gadget/atmel_usba_udc.c10
-rw-r--r--drivers/usb/gadget/configfs.c4
-rw-r--r--drivers/usb/gadget/f_fs.c2
-rw-r--r--drivers/usb/gadget/inode.c4
-rw-r--r--drivers/usb/musb/musb_cppi41.c4
-rw-r--r--drivers/usb/musb/musb_dsps.c61
-rw-r--r--drivers/usb/musb/musb_gadget.c15
-rw-r--r--drivers/usb/musb/musb_host.c2
-rw-r--r--drivers/usb/musb/ux500_dma.c4
-rw-r--r--drivers/usb/phy/phy-am335x-control.c4
-rw-r--r--drivers/usb/phy/phy-fsl-usb.h2
-rw-r--r--drivers/usb/phy/phy-fsm-usb.c2
-rw-r--r--drivers/usb/phy/phy-omap-usb2.c7
21 files changed, 329 insertions, 126 deletions
diff --git a/Documentation/devicetree/bindings/usb/am33xx-usb.txt b/Documentation/devicetree/bindings/usb/am33xx-usb.txt
index dc9dc8c87f15..20c2ff2ba07e 100644
--- a/Documentation/devicetree/bindings/usb/am33xx-usb.txt
+++ b/Documentation/devicetree/bindings/usb/am33xx-usb.txt
@@ -1,35 +1,197 @@
1AM33XX MUSB GLUE 1 AM33xx MUSB
2 - compatible : Should be "ti,musb-am33xx" 2~~~~~~~~~~~~~~~
3 - reg : offset and length of register sets, first usbss, then for musb instances 3- compatible: ti,am33xx-usb
4 - interrupts : usbss, musb instance interrupts in order 4- reg: offset and length of the usbss register sets
5 - ti,hwmods : must be "usb_otg_hs" 5- ti,hwmods : must be "usb_otg_hs"
6 - multipoint : Should be "1" indicating the musb controller supports 6
7 multipoint. This is a MUSB configuration-specific setting. 7The glue layer contains multiple child nodes. It is required the have
8 - num-eps : Specifies the number of endpoints. This is also a 8at least a control module node, USB node and a PHY node. The second USB
9 MUSB configuration-specific setting. Should be set to "16" 9node and its PHY node is optional. The DMA node is also optional.
10 - ram-bits : Specifies the ram address size. Should be set to "12" 10
11 - port0-mode : Should be "3" to represent OTG. "1" signifies HOST and "2" 11Reset module
12 represents PERIPHERAL. 12~~~~~~~~~~~~
13 - port1-mode : Should be "1" to represent HOST. "3" signifies OTG and "2" 13- compatible: ti,am335x-usb-ctrl-module
14 represents PERIPHERAL. 14- reg: offset and length of the "USB control registers" in the "Control
15 - power : Should be "250". This signifies the controller can supply up to 15 Module" block. A second offset and length for the USB wake up control
16 500mA when operating in host mode. 16 in the same memory block.
17- reg-names: "phy_ctrl" for the "USB control registers" and "wakeup" for
18 the USB wake up control register.
19
20USB PHY
21~~~~~~~
22compatible: ti,am335x-usb-phy
23reg: offset and length of the "USB PHY" register space
24ti,ctrl_mod: reference to the "reset module" node
25reg-names: phy
26The PHY should have a "phy" alias numbered properly in the alias
27node.
28
29USB
30~~~
31- compatible: ti,musb-am33xx
32- reg: offset and length of "USB Controller Registers", and offset and
33 length of "USB Core" register space.
34- reg-names: control for the ""USB Controller Registers" and "mc" for
35 "USB Core" register space
36- interrupts: USB interrupt number
37- interrupt-names: mc
38- dr_mode: Should be one of "host", "peripheral" or "otg".
39- mentor,multipoint: Should be "1" indicating the musb controller supports
40 multipoint. This is a MUSB configuration-specific setting.
41- mentor,num-eps: Specifies the number of endpoints. This is also a
42 MUSB configuration-specific setting. Should be set to "16"
43- mentor,ram-bits: Specifies the ram address size. Should be set to "12"
44- mentor,power: Should be "500". This signifies the controller can supply up to
45 500mA when operating in host mode.
46- phys: reference to the USB phy
47- dmas: specifies the dma channels
48- dma-names: specifies the names of the channels. Use "rxN" for receive
49 and "txN" for transmit endpoints. N specifies the endpoint number.
50
51The controller should have an "usb" alias numbered properly in the alias
52node.
53
54DMA
55~~~
56- compatible: ti,am3359-cppi41
57- reg: offset and length of the following register spaces: USBSS, USB
58 CPPI DMA Controller, USB CPPI DMA Scheduler, USB Queue Manager
59- reg-names: glue, controller, scheduler, queuemgr
60- #dma-cells: should be set to 2. The first number represents the
61 endpoint number (0 … 14 for endpoints 1 … 15 on instance 0 and 15 … 29
62 for endpoints 1 … 15 on instance 1). The second number is 0 for RX and
63 1 for TX transfers.
64- #dma-channels: should be set to 30 representing the 15 endpoints for
65 each USB instance.
17 66
18Example: 67Example:
68~~~~~~~~
69The following example contains all the nodes as used on am335x-evm:
70
71aliases {
72 usb0 = &usb0;
73 usb1 = &usb1;
74 phy0 = &usb0_phy;
75 phy1 = &usb1_phy;
76};
19 77
20usb@47400000 { 78usb: usb@47400000 {
21 compatible = "ti,musb-am33xx"; 79 compatible = "ti,am33xx-usb";
22 reg = <0x47400000 0x1000 /* usbss */ 80 reg = <0x47400000 0x1000>;
23 0x47401000 0x800 /* musb instance 0 */ 81 ranges;
24 0x47401800 0x800>; /* musb instance 1 */ 82 #address-cells = <1>;
25 interrupts = <17 /* usbss */ 83 #size-cells = <1>;
26 18 /* musb instance 0 */
27 19>; /* musb instance 1 */
28 multipoint = <1>;
29 num-eps = <16>;
30 ram-bits = <12>;
31 port0-mode = <3>;
32 port1-mode = <3>;
33 power = <250>;
34 ti,hwmods = "usb_otg_hs"; 84 ti,hwmods = "usb_otg_hs";
85
86 ctrl_mod: control@44e10000 {
87 compatible = "ti,am335x-usb-ctrl-module";
88 reg = <0x44e10620 0x10
89 0x44e10648 0x4>;
90 reg-names = "phy_ctrl", "wakeup";
91 };
92
93 usb0_phy: usb-phy@47401300 {
94 compatible = "ti,am335x-usb-phy";
95 reg = <0x47401300 0x100>;
96 reg-names = "phy";
97 ti,ctrl_mod = <&ctrl_mod>;
98 };
99
100 usb0: usb@47401000 {
101 compatible = "ti,musb-am33xx";
102 reg = <0x47401400 0x400
103 0x47401000 0x200>;
104 reg-names = "mc", "control";
105
106 interrupts = <18>;
107 interrupt-names = "mc";
108 dr_mode = "otg"
109 mentor,multipoint = <1>;
110 mentor,num-eps = <16>;
111 mentor,ram-bits = <12>;
112 mentor,power = <500>;
113 phys = <&usb0_phy>;
114
115 dmas = <&cppi41dma 0 0 &cppi41dma 1 0
116 &cppi41dma 2 0 &cppi41dma 3 0
117 &cppi41dma 4 0 &cppi41dma 5 0
118 &cppi41dma 6 0 &cppi41dma 7 0
119 &cppi41dma 8 0 &cppi41dma 9 0
120 &cppi41dma 10 0 &cppi41dma 11 0
121 &cppi41dma 12 0 &cppi41dma 13 0
122 &cppi41dma 14 0 &cppi41dma 0 1
123 &cppi41dma 1 1 &cppi41dma 2 1
124 &cppi41dma 3 1 &cppi41dma 4 1
125 &cppi41dma 5 1 &cppi41dma 6 1
126 &cppi41dma 7 1 &cppi41dma 8 1
127 &cppi41dma 9 1 &cppi41dma 10 1
128 &cppi41dma 11 1 &cppi41dma 12 1
129 &cppi41dma 13 1 &cppi41dma 14 1>;
130 dma-names =
131 "rx1", "rx2", "rx3", "rx4", "rx5", "rx6", "rx7",
132 "rx8", "rx9", "rx10", "rx11", "rx12", "rx13",
133 "rx14", "rx15",
134 "tx1", "tx2", "tx3", "tx4", "tx5", "tx6", "tx7",
135 "tx8", "tx9", "tx10", "tx11", "tx12", "tx13",
136 "tx14", "tx15";
137 };
138
139 usb1_phy: usb-phy@47401b00 {
140 compatible = "ti,am335x-usb-phy";
141 reg = <0x47401b00 0x100>;
142 reg-names = "phy";
143 ti,ctrl_mod = <&ctrl_mod>;
144 };
145
146 usb1: usb@47401800 {
147 compatible = "ti,musb-am33xx";
148 reg = <0x47401c00 0x400
149 0x47401800 0x200>;
150 reg-names = "mc", "control";
151 interrupts = <19>;
152 interrupt-names = "mc";
153 dr_mode = "host"
154 mentor,multipoint = <1>;
155 mentor,num-eps = <16>;
156 mentor,ram-bits = <12>;
157 mentor,power = <500>;
158 phys = <&usb1_phy>;
159
160 dmas = <&cppi41dma 15 0 &cppi41dma 16 0
161 &cppi41dma 17 0 &cppi41dma 18 0
162 &cppi41dma 19 0 &cppi41dma 20 0
163 &cppi41dma 21 0 &cppi41dma 22 0
164 &cppi41dma 23 0 &cppi41dma 24 0
165 &cppi41dma 25 0 &cppi41dma 26 0
166 &cppi41dma 27 0 &cppi41dma 28 0
167 &cppi41dma 29 0 &cppi41dma 15 1
168 &cppi41dma 16 1 &cppi41dma 17 1
169 &cppi41dma 18 1 &cppi41dma 19 1
170 &cppi41dma 20 1 &cppi41dma 21 1
171 &cppi41dma 22 1 &cppi41dma 23 1
172 &cppi41dma 24 1 &cppi41dma 25 1
173 &cppi41dma 26 1 &cppi41dma 27 1
174 &cppi41dma 28 1 &cppi41dma 29 1>;
175 dma-names =
176 "rx1", "rx2", "rx3", "rx4", "rx5", "rx6", "rx7",
177 "rx8", "rx9", "rx10", "rx11", "rx12", "rx13",
178 "rx14", "rx15",
179 "tx1", "tx2", "tx3", "tx4", "tx5", "tx6", "tx7",
180 "tx8", "tx9", "tx10", "tx11", "tx12", "tx13",
181 "tx14", "tx15";
182 };
183
184 cppi41dma: dma-controller@07402000 {
185 compatible = "ti,am3359-cppi41";
186 reg = <0x47400000 0x1000
187 0x47402000 0x1000
188 0x47403000 0x1000
189 0x47404000 0x4000>;
190 reg-names = "glue", "controller", "scheduler", "queuemgr";
191 interrupts = <17>;
192 interrupt-names = "glue";
193 #dma-cells = <2>;
194 #dma-channels = <30>;
195 #dma-requests = <256>;
196 };
35}; 197};
diff --git a/arch/arm/boot/dts/am335x-bone.dts b/arch/arm/boot/dts/am335x-bone.dts
index a8907b57c75c..d318987d44a1 100644
--- a/arch/arm/boot/dts/am335x-bone.dts
+++ b/arch/arm/boot/dts/am335x-bone.dts
@@ -127,13 +127,26 @@
127 status = "okay"; 127 status = "okay";
128 }; 128 };
129 129
130 phy@47401300 { 130 usb-phy@47401300 {
131 status = "okay";
132 };
133
134 usb-phy@47401b00 {
131 status = "okay"; 135 status = "okay";
132 }; 136 };
133 137
134 usb@47401000 { 138 usb@47401000 {
135 status = "okay"; 139 status = "okay";
136 }; 140 };
141
142 usb@47401800 {
143 status = "okay";
144 dr_mode = "host";
145 };
146
147 dma-controller@07402000 {
148 status = "okay";
149 };
137 }; 150 };
138 151
139 i2c0: i2c@44e0b000 { 152 i2c0: i2c@44e0b000 {
diff --git a/arch/arm/boot/dts/am335x-evm.dts b/arch/arm/boot/dts/am335x-evm.dts
index c26c16cace3c..e8ec8756e498 100644
--- a/arch/arm/boot/dts/am335x-evm.dts
+++ b/arch/arm/boot/dts/am335x-evm.dts
@@ -178,11 +178,11 @@
178 status = "okay"; 178 status = "okay";
179 }; 179 };
180 180
181 phy@47401300 { 181 usb-phy@47401300 {
182 status = "okay"; 182 status = "okay";
183 }; 183 };
184 184
185 phy@47401b00 { 185 usb-phy@47401b00 {
186 status = "okay"; 186 status = "okay";
187 }; 187 };
188 188
@@ -192,9 +192,10 @@
192 192
193 usb@47401800 { 193 usb@47401800 {
194 status = "okay"; 194 status = "okay";
195 dr_mode = "host";
195 }; 196 };
196 197
197 dma@07402000 { 198 dma-controller@07402000 {
198 status = "okay"; 199 status = "okay";
199 }; 200 };
200 }; 201 };
diff --git a/arch/arm/boot/dts/am335x-evmsk.dts b/arch/arm/boot/dts/am335x-evmsk.dts
index e92446c6846e..a6c5033be442 100644
--- a/arch/arm/boot/dts/am335x-evmsk.dts
+++ b/arch/arm/boot/dts/am335x-evmsk.dts
@@ -214,7 +214,7 @@
214 status = "okay"; 214 status = "okay";
215 }; 215 };
216 216
217 phy@47401300 { 217 usb-phy@47401300 {
218 status = "okay"; 218 status = "okay";
219 }; 219 };
220 220
diff --git a/arch/arm/boot/dts/am33xx.dtsi b/arch/arm/boot/dts/am33xx.dtsi
index 24d63095ab83..f9c5da9c7fe1 100644
--- a/arch/arm/boot/dts/am33xx.dtsi
+++ b/arch/arm/boot/dts/am33xx.dtsi
@@ -354,7 +354,7 @@
354 status = "disabled"; 354 status = "disabled";
355 }; 355 };
356 356
357 usb0_phy: phy@47401300 { 357 usb0_phy: usb-phy@47401300 {
358 compatible = "ti,am335x-usb-phy"; 358 compatible = "ti,am335x-usb-phy";
359 reg = <0x47401300 0x100>; 359 reg = <0x47401300 0x100>;
360 reg-names = "phy"; 360 reg-names = "phy";
@@ -364,25 +364,19 @@
364 364
365 usb0: usb@47401000 { 365 usb0: usb@47401000 {
366 compatible = "ti,musb-am33xx"; 366 compatible = "ti,musb-am33xx";
367 ranges;
368 #address-cells = <1>;
369 #size-cells = <1>;
370 reg = <0x47401000 0x200>;
371 reg-names = "control";
372 status = "disabled"; 367 status = "disabled";
373 368 reg = <0x47401400 0x400
374 musb0: usb@47401400 { 369 0x47401000 0x200>;
375 compatible = "mg,musbmhdrc"; 370 reg-names = "mc", "control";
376 reg = <0x47401400 0x400>; 371
377 reg-names = "mc"; 372 interrupts = <18>;
378 interrupts = <18>; 373 interrupt-names = "mc";
379 interrupt-names = "mc"; 374 dr_mode = "otg";
380 multipoint = <1>; 375 mentor,multipoint = <1>;
381 num-eps = <16>; 376 mentor,num-eps = <16>;
382 ram-bits = <12>; 377 mentor,ram-bits = <12>;
383 port-mode = <3>; 378 mentor,power = <500>;
384 power = <250>; 379 phys = <&usb0_phy>;
385 phys = <&usb0_phy>;
386 380
387 dmas = <&cppi41dma 0 0 &cppi41dma 1 0 381 dmas = <&cppi41dma 0 0 &cppi41dma 1 0
388 &cppi41dma 2 0 &cppi41dma 3 0 382 &cppi41dma 2 0 &cppi41dma 3 0
@@ -406,10 +400,9 @@
406 "tx1", "tx2", "tx3", "tx4", "tx5", "tx6", "tx7", 400 "tx1", "tx2", "tx3", "tx4", "tx5", "tx6", "tx7",
407 "tx8", "tx9", "tx10", "tx11", "tx12", "tx13", 401 "tx8", "tx9", "tx10", "tx11", "tx12", "tx13",
408 "tx14", "tx15"; 402 "tx14", "tx15";
409 };
410 }; 403 };
411 404
412 usb1_phy: phy@47401b00 { 405 usb1_phy: usb-phy@47401b00 {
413 compatible = "ti,am335x-usb-phy"; 406 compatible = "ti,am335x-usb-phy";
414 reg = <0x47401b00 0x100>; 407 reg = <0x47401b00 0x100>;
415 reg-names = "phy"; 408 reg-names = "phy";
@@ -419,25 +412,18 @@
419 412
420 usb1: usb@47401800 { 413 usb1: usb@47401800 {
421 compatible = "ti,musb-am33xx"; 414 compatible = "ti,musb-am33xx";
422 ranges;
423 #address-cells = <1>;
424 #size-cells = <1>;
425 reg = <0x47401800 0x200>;
426 reg-names = "control";
427 status = "disabled"; 415 status = "disabled";
428 416 reg = <0x47401c00 0x400
429 musb1: usb@47401c00 { 417 0x47401800 0x200>;
430 compatible = "mg,musbmhdrc"; 418 reg-names = "mc", "control";
431 reg = <0x47401c00 0x400>; 419 interrupts = <19>;
432 reg-names = "mc"; 420 interrupt-names = "mc";
433 interrupts = <19>; 421 dr_mode = "otg";
434 interrupt-names = "mc"; 422 mentor,multipoint = <1>;
435 multipoint = <1>; 423 mentor,num-eps = <16>;
436 num-eps = <16>; 424 mentor,ram-bits = <12>;
437 ram-bits = <12>; 425 mentor,power = <500>;
438 port-mode = <3>; 426 phys = <&usb1_phy>;
439 power = <250>;
440 phys = <&usb1_phy>;
441 427
442 dmas = <&cppi41dma 15 0 &cppi41dma 16 0 428 dmas = <&cppi41dma 15 0 &cppi41dma 16 0
443 &cppi41dma 17 0 &cppi41dma 18 0 429 &cppi41dma 17 0 &cppi41dma 18 0
@@ -461,16 +447,15 @@
461 "tx1", "tx2", "tx3", "tx4", "tx5", "tx6", "tx7", 447 "tx1", "tx2", "tx3", "tx4", "tx5", "tx6", "tx7",
462 "tx8", "tx9", "tx10", "tx11", "tx12", "tx13", 448 "tx8", "tx9", "tx10", "tx11", "tx12", "tx13",
463 "tx14", "tx15"; 449 "tx14", "tx15";
464 };
465 }; 450 };
466 451
467 cppi41dma: dma@07402000 { 452 cppi41dma: dma-controller@07402000 {
468 compatible = "ti,am3359-cppi41"; 453 compatible = "ti,am3359-cppi41";
469 reg = <0x47400000 0x1000 454 reg = <0x47400000 0x1000
470 0x47402000 0x1000 455 0x47402000 0x1000
471 0x47403000 0x1000 456 0x47403000 0x1000
472 0x47404000 0x4000>; 457 0x47404000 0x4000>;
473 reg-names = "glue controller scheduler queuemgr"; 458 reg-names = "glue", "controller", "scheduler", "queuemgr";
474 interrupts = <17>; 459 interrupts = <17>;
475 interrupt-names = "glue"; 460 interrupt-names = "glue";
476 #dma-cells = <2>; 461 #dma-cells = <2>;
diff --git a/drivers/dma/cppi41.c b/drivers/dma/cppi41.c
index 5dcebca37760..6c4e64f2f3e7 100644
--- a/drivers/dma/cppi41.c
+++ b/drivers/dma/cppi41.c
@@ -9,6 +9,7 @@
9#include <linux/dmapool.h> 9#include <linux/dmapool.h>
10#include <linux/interrupt.h> 10#include <linux/interrupt.h>
11#include <linux/of_address.h> 11#include <linux/of_address.h>
12#include <linux/pm_runtime.h>
12#include "dmaengine.h" 13#include "dmaengine.h"
13 14
14#define DESC_TYPE 27 15#define DESC_TYPE 27
@@ -579,7 +580,7 @@ static int cppi41_tear_down_chan(struct cppi41_channel *c)
579 WARN_ON(!c->is_tx && !(pd0 & TD_DESC_IS_RX)); 580 WARN_ON(!c->is_tx && !(pd0 & TD_DESC_IS_RX));
580 WARN_ON((pd0 & 0x1f) != c->port_num); 581 WARN_ON((pd0 & 0x1f) != c->port_num);
581 } else { 582 } else {
582 __WARN(); 583 WARN_ON_ONCE(1);
583 } 584 }
584 c->td_seen = 1; 585 c->td_seen = 1;
585 } 586 }
@@ -960,6 +961,11 @@ static int cppi41_dma_probe(struct platform_device *pdev)
960 goto err_remap; 961 goto err_remap;
961 } 962 }
962 963
964 pm_runtime_enable(&pdev->dev);
965 ret = pm_runtime_get_sync(&pdev->dev);
966 if (ret)
967 goto err_get_sync;
968
963 cdd->queues_rx = glue_info->queues_rx; 969 cdd->queues_rx = glue_info->queues_rx;
964 cdd->queues_tx = glue_info->queues_tx; 970 cdd->queues_tx = glue_info->queues_tx;
965 cdd->td_queue = glue_info->td_queue; 971 cdd->td_queue = glue_info->td_queue;
@@ -1005,6 +1011,9 @@ err_irq:
1005err_chans: 1011err_chans:
1006 deinit_cpii41(pdev, cdd); 1012 deinit_cpii41(pdev, cdd);
1007err_init_cppi: 1013err_init_cppi:
1014 pm_runtime_put(&pdev->dev);
1015err_get_sync:
1016 pm_runtime_disable(&pdev->dev);
1008 iounmap(cdd->usbss_mem); 1017 iounmap(cdd->usbss_mem);
1009 iounmap(cdd->ctrl_mem); 1018 iounmap(cdd->ctrl_mem);
1010 iounmap(cdd->sched_mem); 1019 iounmap(cdd->sched_mem);
@@ -1029,6 +1038,8 @@ static int cppi41_dma_remove(struct platform_device *pdev)
1029 iounmap(cdd->ctrl_mem); 1038 iounmap(cdd->ctrl_mem);
1030 iounmap(cdd->sched_mem); 1039 iounmap(cdd->sched_mem);
1031 iounmap(cdd->qmgr_mem); 1040 iounmap(cdd->qmgr_mem);
1041 pm_runtime_put(&pdev->dev);
1042 pm_runtime_disable(&pdev->dev);
1032 kfree(cdd); 1043 kfree(cdd);
1033 return 0; 1044 return 0;
1034} 1045}
diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
index 577af1b237f2..474162e9d01d 100644
--- a/drivers/usb/dwc3/core.c
+++ b/drivers/usb/dwc3/core.c
@@ -33,7 +33,6 @@
33#include <linux/dma-mapping.h> 33#include <linux/dma-mapping.h>
34#include <linux/of.h> 34#include <linux/of.h>
35 35
36#include <linux/usb/otg.h>
37#include <linux/usb/ch9.h> 36#include <linux/usb/ch9.h>
38#include <linux/usb/gadget.h> 37#include <linux/usb/gadget.h>
39#include <linux/usb/of.h> 38#include <linux/usb/of.h>
diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig
index bddd7ede5455..30e2dd8a1f2c 100644
--- a/drivers/usb/gadget/Kconfig
+++ b/drivers/usb/gadget/Kconfig
@@ -187,7 +187,7 @@ config USB_FSL_USB2
187 187
188config USB_FUSB300 188config USB_FUSB300
189 tristate "Faraday FUSB300 USB Peripheral Controller" 189 tristate "Faraday FUSB300 USB Peripheral Controller"
190 depends on !PHYS_ADDR_T_64BIT 190 depends on !PHYS_ADDR_T_64BIT && HAS_DMA
191 help 191 help
192 Faraday usb device controller FUSB300 driver 192 Faraday usb device controller FUSB300 driver
193 193
@@ -244,6 +244,7 @@ config USB_PXA25X_SMALL
244 244
245config USB_R8A66597 245config USB_R8A66597
246 tristate "Renesas R8A66597 USB Peripheral Controller" 246 tristate "Renesas R8A66597 USB Peripheral Controller"
247 depends on HAS_DMA
247 help 248 help
248 R8A66597 is a discrete USB host and peripheral controller chip that 249 R8A66597 is a discrete USB host and peripheral controller chip that
249 supports both full and high speed USB 2.0 data transfers. 250 supports both full and high speed USB 2.0 data transfers.
@@ -385,7 +386,7 @@ config USB_NET2272
385 386
386config USB_NET2272_DMA 387config USB_NET2272_DMA
387 boolean "Support external DMA controller" 388 boolean "Support external DMA controller"
388 depends on USB_NET2272 389 depends on USB_NET2272 && HAS_DMA
389 help 390 help
390 The NET2272 part can optionally support an external DMA 391 The NET2272 part can optionally support an external DMA
391 controller, but your board has to have support in the 392 controller, but your board has to have support in the
diff --git a/drivers/usb/gadget/atmel_usba_udc.c b/drivers/usb/gadget/atmel_usba_udc.c
index 40d23384b716..2cb52e0438df 100644
--- a/drivers/usb/gadget/atmel_usba_udc.c
+++ b/drivers/usb/gadget/atmel_usba_udc.c
@@ -1772,7 +1772,7 @@ out:
1772static int atmel_usba_start(struct usb_gadget *gadget, 1772static int atmel_usba_start(struct usb_gadget *gadget,
1773 struct usb_gadget_driver *driver) 1773 struct usb_gadget_driver *driver)
1774{ 1774{
1775 int ret = 0; 1775 int ret;
1776 struct usba_udc *udc = container_of(gadget, struct usba_udc, gadget); 1776 struct usba_udc *udc = container_of(gadget, struct usba_udc, gadget);
1777 unsigned long flags; 1777 unsigned long flags;
1778 1778
@@ -1784,11 +1784,11 @@ static int atmel_usba_start(struct usb_gadget *gadget,
1784 1784
1785 ret = clk_prepare_enable(udc->pclk); 1785 ret = clk_prepare_enable(udc->pclk);
1786 if (ret) 1786 if (ret)
1787 goto out; 1787 return ret;
1788 ret = clk_prepare_enable(udc->hclk); 1788 ret = clk_prepare_enable(udc->hclk);
1789 if (ret) { 1789 if (ret) {
1790 clk_disable_unprepare(udc->pclk); 1790 clk_disable_unprepare(udc->pclk);
1791 goto out; 1791 return ret;
1792 } 1792 }
1793 1793
1794 DBG(DBG_GADGET, "registered driver `%s'\n", driver->driver.name); 1794 DBG(DBG_GADGET, "registered driver `%s'\n", driver->driver.name);
@@ -1804,11 +1804,9 @@ static int atmel_usba_start(struct usb_gadget *gadget,
1804 usba_writel(udc, CTRL, USBA_ENABLE_MASK); 1804 usba_writel(udc, CTRL, USBA_ENABLE_MASK);
1805 usba_writel(udc, INT_ENB, USBA_END_OF_RESET); 1805 usba_writel(udc, INT_ENB, USBA_END_OF_RESET);
1806 } 1806 }
1807
1808out:
1809 spin_unlock_irqrestore(&udc->lock, flags); 1807 spin_unlock_irqrestore(&udc->lock, flags);
1810 1808
1811 return ret; 1809 return 0;
1812} 1810}
1813 1811
1814static int atmel_usba_stop(struct usb_gadget *gadget, 1812static int atmel_usba_stop(struct usb_gadget *gadget,
diff --git a/drivers/usb/gadget/configfs.c b/drivers/usb/gadget/configfs.c
index 80e7f75a56c7..8f0d6141e5e6 100644
--- a/drivers/usb/gadget/configfs.c
+++ b/drivers/usb/gadget/configfs.c
@@ -859,8 +859,10 @@ static int configfs_composite_bind(struct usb_gadget *gadget,
859 list_for_each_entry_safe(f, tmp, &cfg->func_list, list) { 859 list_for_each_entry_safe(f, tmp, &cfg->func_list, list) {
860 list_del(&f->list); 860 list_del(&f->list);
861 ret = usb_add_function(c, f); 861 ret = usb_add_function(c, f);
862 if (ret) 862 if (ret) {
863 list_add(&f->list, &cfg->func_list);
863 goto err_purge_funcs; 864 goto err_purge_funcs;
865 }
864 } 866 }
865 usb_ep_autoconfig_reset(cdev->gadget); 867 usb_ep_autoconfig_reset(cdev->gadget);
866 } 868 }
diff --git a/drivers/usb/gadget/f_fs.c b/drivers/usb/gadget/f_fs.c
index f394f295d63d..1a66c5baa0d1 100644
--- a/drivers/usb/gadget/f_fs.c
+++ b/drivers/usb/gadget/f_fs.c
@@ -1417,8 +1417,8 @@ static void functionfs_unbind(struct ffs_data *ffs)
1417 usb_ep_free_request(ffs->gadget->ep0, ffs->ep0req); 1417 usb_ep_free_request(ffs->gadget->ep0, ffs->ep0req);
1418 ffs->ep0req = NULL; 1418 ffs->ep0req = NULL;
1419 ffs->gadget = NULL; 1419 ffs->gadget = NULL;
1420 ffs_data_put(ffs);
1421 clear_bit(FFS_FL_BOUND, &ffs->flags); 1420 clear_bit(FFS_FL_BOUND, &ffs->flags);
1421 ffs_data_put(ffs);
1422 } 1422 }
1423} 1423}
1424 1424
diff --git a/drivers/usb/gadget/inode.c b/drivers/usb/gadget/inode.c
index 570c005062ab..465ef8e2cc91 100644
--- a/drivers/usb/gadget/inode.c
+++ b/drivers/usb/gadget/inode.c
@@ -1270,10 +1270,6 @@ dev_release (struct inode *inode, struct file *fd)
1270 dev->buf = NULL; 1270 dev->buf = NULL;
1271 put_dev (dev); 1271 put_dev (dev);
1272 1272
1273 /* other endpoints were all decoupled from this device */
1274 spin_lock_irq(&dev->lock);
1275 dev->state = STATE_DEV_DISABLED;
1276 spin_unlock_irq(&dev->lock);
1277 return 0; 1273 return 0;
1278} 1274}
1279 1275
diff --git a/drivers/usb/musb/musb_cppi41.c b/drivers/usb/musb/musb_cppi41.c
index e64701d15401..ae959746f77f 100644
--- a/drivers/usb/musb/musb_cppi41.c
+++ b/drivers/usb/musb/musb_cppi41.c
@@ -150,8 +150,10 @@ static void cppi41_dma_callback(void *private_data)
150 remain_bytes, 150 remain_bytes,
151 direction, 151 direction,
152 DMA_PREP_INTERRUPT | DMA_CTRL_ACK); 152 DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
153 if (WARN_ON(!dma_desc)) 153 if (WARN_ON(!dma_desc)) {
154 spin_unlock_irqrestore(&musb->lock, flags);
154 return; 155 return;
156 }
155 157
156 dma_desc->callback = cppi41_dma_callback; 158 dma_desc->callback = cppi41_dma_callback;
157 dma_desc->callback_param = channel; 159 dma_desc->callback_param = channel;
diff --git a/drivers/usb/musb/musb_dsps.c b/drivers/usb/musb/musb_dsps.c
index 4ffbaace7913..4047cbb91bac 100644
--- a/drivers/usb/musb/musb_dsps.c
+++ b/drivers/usb/musb/musb_dsps.c
@@ -44,6 +44,7 @@
44#include <linux/of_device.h> 44#include <linux/of_device.h>
45#include <linux/of_address.h> 45#include <linux/of_address.h>
46#include <linux/of_irq.h> 46#include <linux/of_irq.h>
47#include <linux/usb/of.h>
47 48
48#include "musb_core.h" 49#include "musb_core.h"
49 50
@@ -230,6 +231,8 @@ static void dsps_musb_try_idle(struct musb *musb, unsigned long timeout)
230 glue->last_timer = jiffies; 231 glue->last_timer = jiffies;
231 return; 232 return;
232 } 233 }
234 if (musb->port_mode == MUSB_PORT_MODE_HOST)
235 return;
233 236
234 if (time_after(glue->last_timer, timeout) && 237 if (time_after(glue->last_timer, timeout) &&
235 timer_pending(&glue->timer)) { 238 timer_pending(&glue->timer)) {
@@ -313,7 +316,6 @@ static irqreturn_t dsps_interrupt(int irq, void *hci)
313 jiffies + wrp->poll_seconds * HZ); 316 jiffies + wrp->poll_seconds * HZ);
314 WARNING("VBUS error workaround (delay coming)\n"); 317 WARNING("VBUS error workaround (delay coming)\n");
315 } else if (drvvbus) { 318 } else if (drvvbus) {
316 musb->is_active = 1;
317 MUSB_HST_MODE(musb); 319 MUSB_HST_MODE(musb);
318 musb->xceiv->otg->default_a = 1; 320 musb->xceiv->otg->default_a = 1;
319 musb->xceiv->state = OTG_STATE_A_WAIT_VRISE; 321 musb->xceiv->state = OTG_STATE_A_WAIT_VRISE;
@@ -361,8 +363,8 @@ static int dsps_musb_init(struct musb *musb)
361 return -EINVAL; 363 return -EINVAL;
362 364
363 reg_base = devm_ioremap_resource(dev, r); 365 reg_base = devm_ioremap_resource(dev, r);
364 if (!musb->ctrl_base) 366 if (IS_ERR(reg_base))
365 return -EINVAL; 367 return PTR_ERR(reg_base);
366 musb->ctrl_base = reg_base; 368 musb->ctrl_base = reg_base;
367 369
368 /* NOP driver needs change if supporting dual instance */ 370 /* NOP driver needs change if supporting dual instance */
@@ -425,35 +427,51 @@ static int get_int_prop(struct device_node *dn, const char *s)
425 return val; 427 return val;
426} 428}
427 429
430static int get_musb_port_mode(struct device *dev)
431{
432 enum usb_dr_mode mode;
433
434 mode = of_usb_get_dr_mode(dev->of_node);
435 switch (mode) {
436 case USB_DR_MODE_HOST:
437 return MUSB_PORT_MODE_HOST;
438
439 case USB_DR_MODE_PERIPHERAL:
440 return MUSB_PORT_MODE_GADGET;
441
442 case USB_DR_MODE_UNKNOWN:
443 case USB_DR_MODE_OTG:
444 default:
445 return MUSB_PORT_MODE_DUAL_ROLE;
446 };
447}
448
428static int dsps_create_musb_pdev(struct dsps_glue *glue, 449static int dsps_create_musb_pdev(struct dsps_glue *glue,
429 struct platform_device *parent) 450 struct platform_device *parent)
430{ 451{
431 struct musb_hdrc_platform_data pdata; 452 struct musb_hdrc_platform_data pdata;
432 struct resource resources[2]; 453 struct resource resources[2];
454 struct resource *res;
433 struct device *dev = &parent->dev; 455 struct device *dev = &parent->dev;
434 struct musb_hdrc_config *config; 456 struct musb_hdrc_config *config;
435 struct platform_device *musb; 457 struct platform_device *musb;
436 struct device_node *dn = parent->dev.of_node; 458 struct device_node *dn = parent->dev.of_node;
437 struct device_node *child_node;
438 int ret; 459 int ret;
439 460
440 child_node = of_get_child_by_name(dn, "usb");
441 if (!child_node)
442 return -EINVAL;
443
444 memset(resources, 0, sizeof(resources)); 461 memset(resources, 0, sizeof(resources));
445 ret = of_address_to_resource(child_node, 0, &resources[0]); 462 res = platform_get_resource_byname(parent, IORESOURCE_MEM, "mc");
446 if (ret) { 463 if (!res) {
447 dev_err(dev, "failed to get memory.\n"); 464 dev_err(dev, "failed to get memory.\n");
448 return ret; 465 return -EINVAL;
449 } 466 }
467 resources[0] = *res;
450 468
451 ret = of_irq_to_resource(child_node, 0, &resources[1]); 469 res = platform_get_resource_byname(parent, IORESOURCE_IRQ, "mc");
452 if (ret == 0) { 470 if (!res) {
453 dev_err(dev, "failed to get irq.\n"); 471 dev_err(dev, "failed to get irq.\n");
454 ret = -EINVAL; 472 return -EINVAL;
455 return ret;
456 } 473 }
474 resources[1] = *res;
457 475
458 /* allocate the child platform device */ 476 /* allocate the child platform device */
459 musb = platform_device_alloc("musb-hdrc", PLATFORM_DEVID_AUTO); 477 musb = platform_device_alloc("musb-hdrc", PLATFORM_DEVID_AUTO);
@@ -465,7 +483,7 @@ static int dsps_create_musb_pdev(struct dsps_glue *glue,
465 musb->dev.parent = dev; 483 musb->dev.parent = dev;
466 musb->dev.dma_mask = &musb_dmamask; 484 musb->dev.dma_mask = &musb_dmamask;
467 musb->dev.coherent_dma_mask = musb_dmamask; 485 musb->dev.coherent_dma_mask = musb_dmamask;
468 musb->dev.of_node = of_node_get(child_node); 486 musb->dev.of_node = of_node_get(dn);
469 487
470 glue->musb = musb; 488 glue->musb = musb;
471 489
@@ -485,11 +503,12 @@ static int dsps_create_musb_pdev(struct dsps_glue *glue,
485 pdata.config = config; 503 pdata.config = config;
486 pdata.platform_ops = &dsps_ops; 504 pdata.platform_ops = &dsps_ops;
487 505
488 config->num_eps = get_int_prop(child_node, "num-eps"); 506 config->num_eps = get_int_prop(dn, "mentor,num-eps");
489 config->ram_bits = get_int_prop(child_node, "ram-bits"); 507 config->ram_bits = get_int_prop(dn, "mentor,ram-bits");
490 pdata.mode = get_int_prop(child_node, "port-mode"); 508 pdata.mode = get_musb_port_mode(dev);
491 pdata.power = get_int_prop(child_node, "power"); 509 /* DT keeps this entry in mA, musb expects it as per USB spec */
492 config->multipoint = of_property_read_bool(child_node, "multipoint"); 510 pdata.power = get_int_prop(dn, "mentor,power") / 2;
511 config->multipoint = of_property_read_bool(dn, "mentor,multipoint");
493 512
494 ret = platform_device_add_data(musb, &pdata, sizeof(pdata)); 513 ret = platform_device_add_data(musb, &pdata, sizeof(pdata));
495 if (ret) { 514 if (ret) {
diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c
index 4376f51f5ef1..9a08679d204d 100644
--- a/drivers/usb/musb/musb_gadget.c
+++ b/drivers/usb/musb/musb_gadget.c
@@ -76,13 +76,21 @@ static inline void map_dma_buffer(struct musb_request *request,
76 return; 76 return;
77 77
78 if (request->request.dma == DMA_ADDR_INVALID) { 78 if (request->request.dma == DMA_ADDR_INVALID) {
79 request->request.dma = dma_map_single( 79 dma_addr_t dma_addr;
80 int ret;
81
82 dma_addr = dma_map_single(
80 musb->controller, 83 musb->controller,
81 request->request.buf, 84 request->request.buf,
82 request->request.length, 85 request->request.length,
83 request->tx 86 request->tx
84 ? DMA_TO_DEVICE 87 ? DMA_TO_DEVICE
85 : DMA_FROM_DEVICE); 88 : DMA_FROM_DEVICE);
89 ret = dma_mapping_error(musb->controller, dma_addr);
90 if (ret)
91 return;
92
93 request->request.dma = dma_addr;
86 request->map_state = MUSB_MAPPED; 94 request->map_state = MUSB_MAPPED;
87 } else { 95 } else {
88 dma_sync_single_for_device(musb->controller, 96 dma_sync_single_for_device(musb->controller,
@@ -1804,6 +1812,8 @@ err:
1804 1812
1805void musb_gadget_cleanup(struct musb *musb) 1813void musb_gadget_cleanup(struct musb *musb)
1806{ 1814{
1815 if (musb->port_mode == MUSB_PORT_MODE_HOST)
1816 return;
1807 usb_del_gadget_udc(&musb->g); 1817 usb_del_gadget_udc(&musb->g);
1808} 1818}
1809 1819
@@ -1929,7 +1939,8 @@ static int musb_gadget_stop(struct usb_gadget *g,
1929 stop_activity(musb, driver); 1939 stop_activity(musb, driver);
1930 otg_set_peripheral(musb->xceiv->otg, NULL); 1940 otg_set_peripheral(musb->xceiv->otg, NULL);
1931 1941
1932 dev_dbg(musb->controller, "unregistering driver %s\n", driver->function); 1942 dev_dbg(musb->controller, "unregistering driver %s\n",
1943 driver ? driver->function : "(removed)");
1933 1944
1934 musb->is_active = 0; 1945 musb->is_active = 0;
1935 musb->gadget_driver = NULL; 1946 musb->gadget_driver = NULL;
diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c
index a9695f5a92fb..9a2b8c85f19a 100644
--- a/drivers/usb/musb/musb_host.c
+++ b/drivers/usb/musb/musb_host.c
@@ -2628,6 +2628,8 @@ int musb_host_alloc(struct musb *musb)
2628 2628
2629void musb_host_cleanup(struct musb *musb) 2629void musb_host_cleanup(struct musb *musb)
2630{ 2630{
2631 if (musb->port_mode == MUSB_PORT_MODE_GADGET)
2632 return;
2631 usb_remove_hcd(musb->hcd); 2633 usb_remove_hcd(musb->hcd);
2632 musb->hcd = NULL; 2634 musb->hcd = NULL;
2633} 2635}
diff --git a/drivers/usb/musb/ux500_dma.c b/drivers/usb/musb/ux500_dma.c
index e51dd9b88e71..3700e9713258 100644
--- a/drivers/usb/musb/ux500_dma.c
+++ b/drivers/usb/musb/ux500_dma.c
@@ -333,7 +333,9 @@ static int ux500_dma_controller_start(struct ux500_dma_controller *controller)
333 if (!ux500_channel->dma_chan) 333 if (!ux500_channel->dma_chan)
334 ux500_channel->dma_chan = 334 ux500_channel->dma_chan =
335 dma_request_channel(mask, 335 dma_request_channel(mask,
336 data->dma_filter, 336 data ?
337 data->dma_filter :
338 NULL,
337 param_array[ch_num]); 339 param_array[ch_num]);
338 340
339 if (!ux500_channel->dma_chan) { 341 if (!ux500_channel->dma_chan) {
diff --git a/drivers/usb/phy/phy-am335x-control.c b/drivers/usb/phy/phy-am335x-control.c
index 759754521426..22cf07d62e4c 100644
--- a/drivers/usb/phy/phy-am335x-control.c
+++ b/drivers/usb/phy/phy-am335x-control.c
@@ -42,8 +42,8 @@ static void am335x_phy_power(struct phy_control *phy_ctrl, u32 id, bool on)
42 reg = AM335X_USB1_CTRL; 42 reg = AM335X_USB1_CTRL;
43 break; 43 break;
44 default: 44 default:
45 __WARN(); 45 WARN_ON(1);
46 return; 46 return;
47 } 47 }
48 48
49 val = readl(usb_ctrl->phy_reg + reg); 49 val = readl(usb_ctrl->phy_reg + reg);
diff --git a/drivers/usb/phy/phy-fsl-usb.h b/drivers/usb/phy/phy-fsl-usb.h
index ca266280895d..e1859b8ef567 100644
--- a/drivers/usb/phy/phy-fsl-usb.h
+++ b/drivers/usb/phy/phy-fsl-usb.h
@@ -15,7 +15,7 @@
15 * 675 Mass Ave, Cambridge, MA 02139, USA. 15 * 675 Mass Ave, Cambridge, MA 02139, USA.
16 */ 16 */
17 17
18#include "otg_fsm.h" 18#include "phy-fsm-usb.h"
19#include <linux/usb/otg.h> 19#include <linux/usb/otg.h>
20#include <linux/ioctl.h> 20#include <linux/ioctl.h>
21 21
diff --git a/drivers/usb/phy/phy-fsm-usb.c b/drivers/usb/phy/phy-fsm-usb.c
index c520b3548e7c..7f4596606e18 100644
--- a/drivers/usb/phy/phy-fsm-usb.c
+++ b/drivers/usb/phy/phy-fsm-usb.c
@@ -29,7 +29,7 @@
29#include <linux/usb/gadget.h> 29#include <linux/usb/gadget.h>
30#include <linux/usb/otg.h> 30#include <linux/usb/otg.h>
31 31
32#include "phy-otg-fsm.h" 32#include "phy-fsm-usb.h"
33 33
34/* Change USB protocol when there is a protocol change */ 34/* Change USB protocol when there is a protocol change */
35static int otg_set_protocol(struct otg_fsm *fsm, int protocol) 35static int otg_set_protocol(struct otg_fsm *fsm, int protocol)
diff --git a/drivers/usb/phy/phy-omap-usb2.c b/drivers/usb/phy/phy-omap-usb2.c
index 844ab68f08d0..d266861d24f7 100644
--- a/drivers/usb/phy/phy-omap-usb2.c
+++ b/drivers/usb/phy/phy-omap-usb2.c
@@ -98,8 +98,8 @@ static int omap_usb_set_peripheral(struct usb_otg *otg,
98 98
99static int omap_usb2_suspend(struct usb_phy *x, int suspend) 99static int omap_usb2_suspend(struct usb_phy *x, int suspend)
100{ 100{
101 u32 ret;
102 struct omap_usb *phy = phy_to_omapusb(x); 101 struct omap_usb *phy = phy_to_omapusb(x);
102 int ret;
103 103
104 if (suspend && !phy->is_suspended) { 104 if (suspend && !phy->is_suspended) {
105 omap_control_usb_phy_power(phy->control_dev, 0); 105 omap_control_usb_phy_power(phy->control_dev, 0);
@@ -108,8 +108,7 @@ static int omap_usb2_suspend(struct usb_phy *x, int suspend)
108 } else if (!suspend && phy->is_suspended) { 108 } else if (!suspend && phy->is_suspended) {
109 ret = pm_runtime_get_sync(phy->dev); 109 ret = pm_runtime_get_sync(phy->dev);
110 if (ret < 0) { 110 if (ret < 0) {
111 dev_err(phy->dev, "get_sync failed with err %d\n", 111 dev_err(phy->dev, "get_sync failed with err %d\n", ret);
112 ret);
113 return ret; 112 return ret;
114 } 113 }
115 omap_control_usb_phy_power(phy->control_dev, 1); 114 omap_control_usb_phy_power(phy->control_dev, 1);
@@ -209,9 +208,9 @@ static int omap_usb2_runtime_suspend(struct device *dev)
209 208
210static int omap_usb2_runtime_resume(struct device *dev) 209static int omap_usb2_runtime_resume(struct device *dev)
211{ 210{
212 u32 ret = 0;
213 struct platform_device *pdev = to_platform_device(dev); 211 struct platform_device *pdev = to_platform_device(dev);
214 struct omap_usb *phy = platform_get_drvdata(pdev); 212 struct omap_usb *phy = platform_get_drvdata(pdev);
213 int ret;
215 214
216 ret = clk_enable(phy->wkupclk); 215 ret = clk_enable(phy->wkupclk);
217 if (ret < 0) { 216 if (ret < 0) {