|
@@ -199,30 +199,30 @@ static ssize_t musb_test_mode_write(struct file *file,
|
|
|
if (copy_from_user(&buf, ubuf, min_t(size_t, sizeof(buf) - 1, count)))
|
|
|
return -EFAULT;
|
|
|
|
|
|
- if (!strncmp(buf, "force host", 9))
|
|
|
+ if (strstarts(buf, "force host"))
|
|
|
test = MUSB_TEST_FORCE_HOST;
|
|
|
|
|
|
- if (!strncmp(buf, "fifo access", 11))
|
|
|
+ if (strstarts(buf, "fifo access"))
|
|
|
test = MUSB_TEST_FIFO_ACCESS;
|
|
|
|
|
|
- if (!strncmp(buf, "force full-speed", 15))
|
|
|
+ if (strstarts(buf, "force full-speed"))
|
|
|
test = MUSB_TEST_FORCE_FS;
|
|
|
|
|
|
- if (!strncmp(buf, "force high-speed", 15))
|
|
|
+ if (strstarts(buf, "force high-speed"))
|
|
|
test = MUSB_TEST_FORCE_HS;
|
|
|
|
|
|
- if (!strncmp(buf, "test packet", 10)) {
|
|
|
+ if (strstarts(buf, "test packet")) {
|
|
|
test = MUSB_TEST_PACKET;
|
|
|
musb_load_testpacket(musb);
|
|
|
}
|
|
|
|
|
|
- if (!strncmp(buf, "test K", 6))
|
|
|
+ if (strstarts(buf, "test K"))
|
|
|
test = MUSB_TEST_K;
|
|
|
|
|
|
- if (!strncmp(buf, "test J", 6))
|
|
|
+ if (strstarts(buf, "test J"))
|
|
|
test = MUSB_TEST_J;
|
|
|
|
|
|
- if (!strncmp(buf, "test SE0 NAK", 12))
|
|
|
+ if (strstarts(buf, "test SE0 NAK"))
|
|
|
test = MUSB_TEST_SE0_NAK;
|
|
|
|
|
|
musb_writeb(musb->mregs, MUSB_TESTMODE, test);
|