Skip to content

Commit 62fb45d

Browse files
committed
USB: ch9: add "USB_" prefix in front of TEST defines
For some reason, the TEST_ defines in the usb/ch9.h files did not have the USB_ prefix on it, making it a bit confusing when reading the file, as well as not the nicest thing to do in a uapi file. So fix that up and add the USB_ prefix on to them, and fix up all in-kernel usages. This included deleting the duplicate copy in the net2272.h file. Cc: Felipe Balbi <balbi@kernel.org> Cc: Michal Simek <michal.simek@xilinx.com> Cc: Mathias Nyman <mathias.nyman@intel.com> Cc: Pawel Laszczak <pawell@cadence.com> Cc: YueHaibing <yuehaibing@huawei.com> Cc: Nathan Chancellor <natechancellor@gmail.com> Cc: Jason Yan <yanaijie@huawei.com> Cc: Jia-Ju Bai <baijiaju1990@gmail.com> Cc: Stephen Boyd <swboyd@chromium.org> Cc: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Jules Irenge <jbi.octave@gmail.com> Cc: Alan Stern <stern@rowland.harvard.edu> Cc: Thinh Nguyen <Thinh.Nguyen@synopsys.com> Cc: Rob Gill <rrobgill@protonmail.com> Cc: Macpaul Lin <macpaul.lin@mediatek.com> Acked-by: Minas Harutyunyan <hminas@synopsys.com> Acked-by: Bin Liu <b-liu@ti.com> Acked-by: Chunfeng Yun <chunfeng.yun@mediatek.com> Acked-by: Peter Chen <peter.chen@nxp.com> Link: https://lore.kernel.org/r/20200618144206.2655890-1-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent f8f02d5 commit 62fb45d

20 files changed

Lines changed: 99 additions & 107 deletions

File tree

‎drivers/usb/cdns3/ep0.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -328,10 +328,10 @@ static int cdns3_ep0_feature_handle_device(struct cdns3_device *priv_dev,
328328
return -EINVAL;
329329

330330
switch (tmode >> 8) {
331-
case TEST_J:
332-
case TEST_K:
333-
case TEST_SE0_NAK:
334-
case TEST_PACKET:
331+
case USB_TEST_J:
332+
case USB_TEST_K:
333+
case USB_TEST_SE0_NAK:
334+
case USB_TEST_PACKET:
335335
cdns3_set_register_bit(&priv_dev->regs->usb_cmd,
336336
USB_CMD_STMODE |
337337
USB_STS_TMODE_SEL(tmode - 1));

‎drivers/usb/chipidea/udc.c‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1215,11 +1215,11 @@ __acquires(ci->lock)
12151215
case USB_DEVICE_TEST_MODE:
12161216
tmode = le16_to_cpu(req.wIndex) >> 8;
12171217
switch (tmode) {
1218-
case TEST_J:
1219-
case TEST_K:
1220-
case TEST_SE0_NAK:
1221-
case TEST_PACKET:
1222-
case TEST_FORCE_EN:
1218+
case USB_TEST_J:
1219+
case USB_TEST_K:
1220+
case USB_TEST_SE0_NAK:
1221+
case USB_TEST_PACKET:
1222+
case USB_TEST_FORCE_ENABLE:
12231223
ci->test_mode = tmode;
12241224
err = isr_setup_status_phase(
12251225
ci);

‎drivers/usb/common/debug.c‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,15 @@ static const char *usb_decode_device_feature(u16 wValue)
5353
static const char *usb_decode_test_mode(u16 wIndex)
5454
{
5555
switch (wIndex) {
56-
case TEST_J:
56+
case USB_TEST_J:
5757
return ": TEST_J";
58-
case TEST_K:
58+
case USB_TEST_K:
5959
return ": TEST_K";
60-
case TEST_SE0_NAK:
60+
case USB_TEST_SE0_NAK:
6161
return ": TEST_SE0_NAK";
62-
case TEST_PACKET:
62+
case USB_TEST_PACKET:
6363
return ": TEST_PACKET";
64-
case TEST_FORCE_EN:
64+
case USB_TEST_FORCE_ENABLE:
6565
return ": TEST_FORCE_EN";
6666
default:
6767
return ": UNKNOWN";

‎drivers/usb/dwc2/debugfs.c‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@ static ssize_t testmode_write(struct file *file, const char __user *ubuf, size_t
3737
return -EFAULT;
3838

3939
if (!strncmp(buf, "test_j", 6))
40-
testmode = TEST_J;
40+
testmode = USB_TEST_J;
4141
else if (!strncmp(buf, "test_k", 6))
42-
testmode = TEST_K;
42+
testmode = USB_TEST_K;
4343
else if (!strncmp(buf, "test_se0_nak", 12))
44-
testmode = TEST_SE0_NAK;
44+
testmode = USB_TEST_SE0_NAK;
4545
else if (!strncmp(buf, "test_packet", 11))
46-
testmode = TEST_PACKET;
46+
testmode = USB_TEST_PACKET;
4747
else if (!strncmp(buf, "test_force_enable", 17))
48-
testmode = TEST_FORCE_EN;
48+
testmode = USB_TEST_FORCE_ENABLE;
4949
else
5050
testmode = 0;
5151

@@ -78,19 +78,19 @@ static int testmode_show(struct seq_file *s, void *unused)
7878
case 0:
7979
seq_puts(s, "no test\n");
8080
break;
81-
case TEST_J:
81+
case USB_TEST_J:
8282
seq_puts(s, "test_j\n");
8383
break;
84-
case TEST_K:
84+
case USB_TEST_K:
8585
seq_puts(s, "test_k\n");
8686
break;
87-
case TEST_SE0_NAK:
87+
case USB_TEST_SE0_NAK:
8888
seq_puts(s, "test_se0_nak\n");
8989
break;
90-
case TEST_PACKET:
90+
case USB_TEST_PACKET:
9191
seq_puts(s, "test_packet\n");
9292
break;
93-
case TEST_FORCE_EN:
93+
case USB_TEST_FORCE_ENABLE:
9494
seq_puts(s, "test_force_enable\n");
9595
break;
9696
default:

‎drivers/usb/dwc2/gadget.c‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1561,11 +1561,11 @@ int dwc2_hsotg_set_test_mode(struct dwc2_hsotg *hsotg, int testmode)
15611561

15621562
dctl &= ~DCTL_TSTCTL_MASK;
15631563
switch (testmode) {
1564-
case TEST_J:
1565-
case TEST_K:
1566-
case TEST_SE0_NAK:
1567-
case TEST_PACKET:
1568-
case TEST_FORCE_EN:
1564+
case USB_TEST_J:
1565+
case USB_TEST_K:
1566+
case USB_TEST_SE0_NAK:
1567+
case USB_TEST_PACKET:
1568+
case USB_TEST_FORCE_ENABLE:
15691569
dctl |= testmode << DCTL_TSTCTL_SHIFT;
15701570
break;
15711571
default:

‎drivers/usb/dwc3/debugfs.c‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -466,19 +466,19 @@ static int dwc3_testmode_show(struct seq_file *s, void *unused)
466466
case 0:
467467
seq_printf(s, "no test\n");
468468
break;
469-
case TEST_J:
469+
case USB_TEST_J:
470470
seq_printf(s, "test_j\n");
471471
break;
472-
case TEST_K:
472+
case USB_TEST_K:
473473
seq_printf(s, "test_k\n");
474474
break;
475-
case TEST_SE0_NAK:
475+
case USB_TEST_SE0_NAK:
476476
seq_printf(s, "test_se0_nak\n");
477477
break;
478-
case TEST_PACKET:
478+
case USB_TEST_PACKET:
479479
seq_printf(s, "test_packet\n");
480480
break;
481-
case TEST_FORCE_EN:
481+
case USB_TEST_FORCE_ENABLE:
482482
seq_printf(s, "test_force_enable\n");
483483
break;
484484
default:
@@ -506,15 +506,15 @@ static ssize_t dwc3_testmode_write(struct file *file,
506506
return -EFAULT;
507507

508508
if (!strncmp(buf, "test_j", 6))
509-
testmode = TEST_J;
509+
testmode = USB_TEST_J;
510510
else if (!strncmp(buf, "test_k", 6))
511-
testmode = TEST_K;
511+
testmode = USB_TEST_K;
512512
else if (!strncmp(buf, "test_se0_nak", 12))
513-
testmode = TEST_SE0_NAK;
513+
testmode = USB_TEST_SE0_NAK;
514514
else if (!strncmp(buf, "test_packet", 11))
515-
testmode = TEST_PACKET;
515+
testmode = USB_TEST_PACKET;
516516
else if (!strncmp(buf, "test_force_enable", 17))
517-
testmode = TEST_FORCE_EN;
517+
testmode = USB_TEST_FORCE_ENABLE;
518518
else
519519
testmode = 0;
520520

‎drivers/usb/dwc3/ep0.c‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -425,11 +425,11 @@ static int dwc3_ep0_handle_test(struct dwc3 *dwc, enum usb_device_state state,
425425
return -EINVAL;
426426

427427
switch (wIndex >> 8) {
428-
case TEST_J:
429-
case TEST_K:
430-
case TEST_SE0_NAK:
431-
case TEST_PACKET:
432-
case TEST_FORCE_EN:
428+
case USB_TEST_J:
429+
case USB_TEST_K:
430+
case USB_TEST_SE0_NAK:
431+
case USB_TEST_PACKET:
432+
case USB_TEST_FORCE_ENABLE:
433433
dwc->test_mode_nr = wIndex >> 8;
434434
dwc->test_mode = true;
435435
break;

‎drivers/usb/dwc3/gadget.c‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@ int dwc3_gadget_set_test_mode(struct dwc3 *dwc, int mode)
4646
reg &= ~DWC3_DCTL_TSTCTRL_MASK;
4747

4848
switch (mode) {
49-
case TEST_J:
50-
case TEST_K:
51-
case TEST_SE0_NAK:
52-
case TEST_PACKET:
53-
case TEST_FORCE_EN:
49+
case USB_TEST_J:
50+
case USB_TEST_K:
51+
case USB_TEST_SE0_NAK:
52+
case USB_TEST_PACKET:
53+
case USB_TEST_FORCE_ENABLE:
5454
reg |= mode << 1;
5555
break;
5656
default:

‎drivers/usb/gadget/udc/bdc/bdc_ep.c‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -927,11 +927,11 @@ static int bdc_set_test_mode(struct bdc *bdc)
927927
usb2_pm &= ~BDC_PTC_MASK;
928928
dev_dbg(bdc->dev, "%s\n", __func__);
929929
switch (bdc->test_mode) {
930-
case TEST_J:
931-
case TEST_K:
932-
case TEST_SE0_NAK:
933-
case TEST_PACKET:
934-
case TEST_FORCE_EN:
930+
case USB_TEST_J:
931+
case USB_TEST_K:
932+
case USB_TEST_SE0_NAK:
933+
case USB_TEST_PACKET:
934+
case USB_TEST_FORCE_ENABLE:
935935
usb2_pm |= bdc->test_mode << 28;
936936
break;
937937
default:

‎drivers/usb/gadget/udc/gr_udc.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -912,9 +912,9 @@ static int gr_device_request(struct gr_udc *dev, u8 type, u8 request,
912912
return gr_ep0_respond_empty(dev);
913913

914914
case USB_DEVICE_TEST_MODE:
915-
/* The hardware does not support TEST_FORCE_EN */
915+
/* The hardware does not support USB_TEST_FORCE_ENABLE */
916916
test = index >> 8;
917-
if (test >= TEST_J && test <= TEST_PACKET) {
917+
if (test >= USB_TEST_J && test <= USB_TEST_PACKET) {
918918
dev->test_mode = test;
919919
return gr_ep0_respond(dev, NULL, 0,
920920
gr_ep0_testmode_complete);

0 commit comments

Comments
 (0)