Commit 62fb45d3 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

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: default avatarMinas Harutyunyan <hminas@synopsys.com>
Acked-by: default avatarBin Liu <b-liu@ti.com>
Acked-by: default avatarChunfeng Yun <chunfeng.yun@mediatek.com>
Acked-by: default avatarPeter Chen <peter.chen@nxp.com>
Link: https://lore.kernel.org/r/20200618144206.2655890-1-gregkh@linuxfoundation.org


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent f8f02d5c
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -328,10 +328,10 @@ static int cdns3_ep0_feature_handle_device(struct cdns3_device *priv_dev,
			return -EINVAL;

		switch (tmode >> 8) {
		case TEST_J:
		case TEST_K:
		case TEST_SE0_NAK:
		case TEST_PACKET:
		case USB_TEST_J:
		case USB_TEST_K:
		case USB_TEST_SE0_NAK:
		case USB_TEST_PACKET:
			cdns3_set_register_bit(&priv_dev->regs->usb_cmd,
					       USB_CMD_STMODE |
					       USB_STS_TMODE_SEL(tmode - 1));
+5 −5
Original line number Diff line number Diff line
@@ -1215,11 +1215,11 @@ __acquires(ci->lock)
			case USB_DEVICE_TEST_MODE:
				tmode = le16_to_cpu(req.wIndex) >> 8;
				switch (tmode) {
				case TEST_J:
				case TEST_K:
				case TEST_SE0_NAK:
				case TEST_PACKET:
				case TEST_FORCE_EN:
				case USB_TEST_J:
				case USB_TEST_K:
				case USB_TEST_SE0_NAK:
				case USB_TEST_PACKET:
				case USB_TEST_FORCE_ENABLE:
					ci->test_mode = tmode;
					err = isr_setup_status_phase(
							ci);
+5 −5
Original line number Diff line number Diff line
@@ -53,15 +53,15 @@ static const char *usb_decode_device_feature(u16 wValue)
static const char *usb_decode_test_mode(u16 wIndex)
{
	switch (wIndex) {
	case TEST_J:
	case USB_TEST_J:
		return ": TEST_J";
	case TEST_K:
	case USB_TEST_K:
		return ": TEST_K";
	case TEST_SE0_NAK:
	case USB_TEST_SE0_NAK:
		return ": TEST_SE0_NAK";
	case TEST_PACKET:
	case USB_TEST_PACKET:
		return ": TEST_PACKET";
	case TEST_FORCE_EN:
	case USB_TEST_FORCE_ENABLE:
		return ": TEST_FORCE_EN";
	default:
		return ": UNKNOWN";
+10 −10
Original line number Diff line number Diff line
@@ -37,15 +37,15 @@ static ssize_t testmode_write(struct file *file, const char __user *ubuf, size_t
		return -EFAULT;

	if (!strncmp(buf, "test_j", 6))
		testmode = TEST_J;
		testmode = USB_TEST_J;
	else if (!strncmp(buf, "test_k", 6))
		testmode = TEST_K;
		testmode = USB_TEST_K;
	else if (!strncmp(buf, "test_se0_nak", 12))
		testmode = TEST_SE0_NAK;
		testmode = USB_TEST_SE0_NAK;
	else if (!strncmp(buf, "test_packet", 11))
		testmode = TEST_PACKET;
		testmode = USB_TEST_PACKET;
	else if (!strncmp(buf, "test_force_enable", 17))
		testmode = TEST_FORCE_EN;
		testmode = USB_TEST_FORCE_ENABLE;
	else
		testmode = 0;

@@ -78,19 +78,19 @@ static int testmode_show(struct seq_file *s, void *unused)
	case 0:
		seq_puts(s, "no test\n");
		break;
	case TEST_J:
	case USB_TEST_J:
		seq_puts(s, "test_j\n");
		break;
	case TEST_K:
	case USB_TEST_K:
		seq_puts(s, "test_k\n");
		break;
	case TEST_SE0_NAK:
	case USB_TEST_SE0_NAK:
		seq_puts(s, "test_se0_nak\n");
		break;
	case TEST_PACKET:
	case USB_TEST_PACKET:
		seq_puts(s, "test_packet\n");
		break;
	case TEST_FORCE_EN:
	case USB_TEST_FORCE_ENABLE:
		seq_puts(s, "test_force_enable\n");
		break;
	default:
+5 −5
Original line number Diff line number Diff line
@@ -1561,11 +1561,11 @@ int dwc2_hsotg_set_test_mode(struct dwc2_hsotg *hsotg, int testmode)

	dctl &= ~DCTL_TSTCTL_MASK;
	switch (testmode) {
	case TEST_J:
	case TEST_K:
	case TEST_SE0_NAK:
	case TEST_PACKET:
	case TEST_FORCE_EN:
	case USB_TEST_J:
	case USB_TEST_K:
	case USB_TEST_SE0_NAK:
	case USB_TEST_PACKET:
	case USB_TEST_FORCE_ENABLE:
		dctl |= testmode << DCTL_TSTCTL_SHIFT;
		break;
	default:
Loading