Skip to content

Commit 333ab99

Browse files
Linyu Yuangregkh
authored andcommitted
usb: gadget: remove max support speed info in bind operation
Take ecm_bind() for example, it call gadget_is_{*}speed() API to show gadget max support speed, it is not much help, remove the API usage here is safe. Similar change apply to acm,eem,loopback,ncm,obex,rndis,serial, sourcesink,subset functions. Signed-off-by: Linyu Yuan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent dc2e696 commit 333ab99

File tree

10 files changed

+10
-29
lines changed

10 files changed

+10
-29
lines changed

drivers/usb/gadget/function/f_acm.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -691,10 +691,8 @@ acm_bind(struct usb_configuration *c, struct usb_function *f)
691691
goto fail;
692692

693693
dev_dbg(&cdev->gadget->dev,
694-
"acm ttyGS%d: %s speed IN/%s OUT/%s NOTIFY/%s\n",
694+
"acm ttyGS%d: IN/%s OUT/%s NOTIFY/%s\n",
695695
acm->port_num,
696-
gadget_is_superspeed(c->cdev->gadget) ? "super" :
697-
gadget_is_dualspeed(c->cdev->gadget) ? "dual" : "full",
698696
acm->port.in->name, acm->port.out->name,
699697
acm->notify->name);
700698
return 0;

drivers/usb/gadget/function/f_ecm.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -788,9 +788,7 @@ ecm_bind(struct usb_configuration *c, struct usb_function *f)
788788
ecm->port.open = ecm_open;
789789
ecm->port.close = ecm_close;
790790

791-
DBG(cdev, "CDC Ethernet: %s speed IN/%s OUT/%s NOTIFY/%s\n",
792-
gadget_is_superspeed(c->cdev->gadget) ? "super" :
793-
gadget_is_dualspeed(c->cdev->gadget) ? "dual" : "full",
791+
DBG(cdev, "CDC Ethernet: IN/%s OUT/%s NOTIFY/%s\n",
794792
ecm->port.in_ep->name, ecm->port.out_ep->name,
795793
ecm->notify->name);
796794
return 0;

drivers/usb/gadget/function/f_eem.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -311,9 +311,7 @@ static int eem_bind(struct usb_configuration *c, struct usb_function *f)
311311
if (status)
312312
goto fail;
313313

314-
DBG(cdev, "CDC Ethernet (EEM): %s speed IN/%s OUT/%s\n",
315-
gadget_is_superspeed(c->cdev->gadget) ? "super" :
316-
gadget_is_dualspeed(c->cdev->gadget) ? "dual" : "full",
314+
DBG(cdev, "CDC Ethernet (EEM): IN/%s OUT/%s\n",
317315
eem->port.in_ep->name, eem->port.out_ep->name);
318316
return 0;
319317

drivers/usb/gadget/function/f_loopback.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,9 +211,7 @@ static int loopback_bind(struct usb_configuration *c, struct usb_function *f)
211211
if (ret)
212212
return ret;
213213

214-
DBG(cdev, "%s speed %s: IN/%s, OUT/%s\n",
215-
(gadget_is_superspeed(c->cdev->gadget) ? "super" :
216-
(gadget_is_dualspeed(c->cdev->gadget) ? "dual" : "full")),
214+
DBG(cdev, "%s: IN/%s, OUT/%s\n",
217215
f->name, loop->in_ep->name, loop->out_ep->name);
218216
return 0;
219217
}

drivers/usb/gadget/function/f_ncm.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1529,9 +1529,7 @@ static int ncm_bind(struct usb_configuration *c, struct usb_function *f)
15291529
hrtimer_init(&ncm->task_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL_SOFT);
15301530
ncm->task_timer.function = ncm_tx_timeout;
15311531

1532-
DBG(cdev, "CDC Network: %s speed IN/%s OUT/%s NOTIFY/%s\n",
1533-
gadget_is_superspeed(c->cdev->gadget) ? "super" :
1534-
gadget_is_dualspeed(c->cdev->gadget) ? "dual" : "full",
1532+
DBG(cdev, "CDC Network: IN/%s OUT/%s NOTIFY/%s\n",
15351533
ncm->port.in_ep->name, ncm->port.out_ep->name,
15361534
ncm->notify->name);
15371535
return 0;

drivers/usb/gadget/function/f_obex.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -365,9 +365,8 @@ static int obex_bind(struct usb_configuration *c, struct usb_function *f)
365365
if (status)
366366
goto fail;
367367

368-
dev_dbg(&cdev->gadget->dev, "obex ttyGS%d: %s speed IN/%s OUT/%s\n",
368+
dev_dbg(&cdev->gadget->dev, "obex ttyGS%d: IN/%s OUT/%s\n",
369369
obex->port_num,
370-
gadget_is_dualspeed(c->cdev->gadget) ? "dual" : "full",
371370
obex->port.in->name, obex->port.out->name);
372371

373372
return 0;

drivers/usb/gadget/function/f_rndis.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -798,9 +798,7 @@ rndis_bind(struct usb_configuration *c, struct usb_function *f)
798798
* until we're activated via set_alt().
799799
*/
800800

801-
DBG(cdev, "RNDIS: %s speed IN/%s OUT/%s NOTIFY/%s\n",
802-
gadget_is_superspeed(c->cdev->gadget) ? "super" :
803-
gadget_is_dualspeed(c->cdev->gadget) ? "dual" : "full",
801+
DBG(cdev, "RNDIS: IN/%s OUT/%s NOTIFY/%s\n",
804802
rndis->port.in_ep->name, rndis->port.out_ep->name,
805803
rndis->notify->name);
806804
return 0;

drivers/usb/gadget/function/f_serial.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -236,10 +236,8 @@ static int gser_bind(struct usb_configuration *c, struct usb_function *f)
236236
gser_ss_function, gser_ss_function);
237237
if (status)
238238
goto fail;
239-
dev_dbg(&cdev->gadget->dev, "generic ttyGS%d: %s speed IN/%s OUT/%s\n",
239+
dev_dbg(&cdev->gadget->dev, "generic ttyGS%d: IN/%s OUT/%s\n",
240240
gser->port_num,
241-
gadget_is_superspeed(c->cdev->gadget) ? "super" :
242-
gadget_is_dualspeed(c->cdev->gadget) ? "dual" : "full",
243241
gser->port.in->name, gser->port.out->name);
244242
return 0;
245243

drivers/usb/gadget/function/f_sourcesink.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -436,9 +436,7 @@ sourcesink_bind(struct usb_configuration *c, struct usb_function *f)
436436
if (ret)
437437
return ret;
438438

439-
DBG(cdev, "%s speed %s: IN/%s, OUT/%s, ISO-IN/%s, ISO-OUT/%s\n",
440-
(gadget_is_superspeed(c->cdev->gadget) ? "super" :
441-
(gadget_is_dualspeed(c->cdev->gadget) ? "dual" : "full")),
439+
DBG(cdev, "%s: IN/%s, OUT/%s, ISO-IN/%s, ISO-OUT/%s\n",
442440
f->name, ss->in_ep->name, ss->out_ep->name,
443441
ss->iso_in_ep ? ss->iso_in_ep->name : "<none>",
444442
ss->iso_out_ep ? ss->iso_out_ep->name : "<none>");

drivers/usb/gadget/function/f_subset.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -367,9 +367,7 @@ geth_bind(struct usb_configuration *c, struct usb_function *f)
367367
* until we're activated via set_alt().
368368
*/
369369

370-
DBG(cdev, "CDC Subset: %s speed IN/%s OUT/%s\n",
371-
gadget_is_superspeed(c->cdev->gadget) ? "super" :
372-
gadget_is_dualspeed(c->cdev->gadget) ? "dual" : "full",
370+
DBG(cdev, "CDC Subset: IN/%s OUT/%s\n",
373371
geth->port.in_ep->name, geth->port.out_ep->name);
374372
return 0;
375373

0 commit comments

Comments
 (0)