Commit b8b0ea51 authored by Richard Leitner's avatar Richard Leitner Committed by Felipe Balbi

usb: gadget: serial: replace {V,}DBG macro with dev_{v,}dbg

Replace the VDBG and DBG macro with the kernels "proper" debug macros
(dev_vdbg and dev_dbg) in f_acm.c, f_obex.c & f_serial.c
Signed-off-by: default avatarRichard Leitner <richard.leitner@skidata.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent a1a4caf4
...@@ -313,14 +313,14 @@ static void acm_complete_set_line_coding(struct usb_ep *ep, ...@@ -313,14 +313,14 @@ static void acm_complete_set_line_coding(struct usb_ep *ep,
struct usb_composite_dev *cdev = acm->port.func.config->cdev; struct usb_composite_dev *cdev = acm->port.func.config->cdev;
if (req->status != 0) { if (req->status != 0) {
DBG(cdev, "acm ttyGS%d completion, err %d\n", dev_dbg(&cdev->gadget->dev, "acm ttyGS%d completion, err %d\n",
acm->port_num, req->status); acm->port_num, req->status);
return; return;
} }
/* normal completion */ /* normal completion */
if (req->actual != sizeof(acm->port_line_coding)) { if (req->actual != sizeof(acm->port_line_coding)) {
DBG(cdev, "acm ttyGS%d short resp, len %d\n", dev_dbg(&cdev->gadget->dev, "acm ttyGS%d short resp, len %d\n",
acm->port_num, req->actual); acm->port_num, req->actual);
usb_ep_set_halt(ep); usb_ep_set_halt(ep);
} else { } else {
...@@ -397,14 +397,16 @@ static int acm_setup(struct usb_function *f, const struct usb_ctrlrequest *ctrl) ...@@ -397,14 +397,16 @@ static int acm_setup(struct usb_function *f, const struct usb_ctrlrequest *ctrl)
default: default:
invalid: invalid:
VDBG(cdev, "invalid control req%02x.%02x v%04x i%04x l%d\n", dev_vdbg(&cdev->gadget->dev,
"invalid control req%02x.%02x v%04x i%04x l%d\n",
ctrl->bRequestType, ctrl->bRequest, ctrl->bRequestType, ctrl->bRequest,
w_value, w_index, w_length); w_value, w_index, w_length);
} }
/* respond with data transfer or status phase? */ /* respond with data transfer or status phase? */
if (value >= 0) { if (value >= 0) {
DBG(cdev, "acm ttyGS%d req%02x.%02x v%04x i%04x l%d\n", dev_dbg(&cdev->gadget->dev,
"acm ttyGS%d req%02x.%02x v%04x i%04x l%d\n",
acm->port_num, ctrl->bRequestType, ctrl->bRequest, acm->port_num, ctrl->bRequestType, ctrl->bRequest,
w_value, w_index, w_length); w_value, w_index, w_length);
req->zero = 0; req->zero = 0;
...@@ -428,10 +430,12 @@ static int acm_set_alt(struct usb_function *f, unsigned intf, unsigned alt) ...@@ -428,10 +430,12 @@ static int acm_set_alt(struct usb_function *f, unsigned intf, unsigned alt)
if (intf == acm->ctrl_id) { if (intf == acm->ctrl_id) {
if (acm->notify->driver_data) { if (acm->notify->driver_data) {
VDBG(cdev, "reset acm control interface %d\n", intf); dev_vdbg(&cdev->gadget->dev,
"reset acm control interface %d\n", intf);
usb_ep_disable(acm->notify); usb_ep_disable(acm->notify);
} else { } else {
VDBG(cdev, "init acm ctrl interface %d\n", intf); dev_vdbg(&cdev->gadget->dev,
"init acm ctrl interface %d\n", intf);
if (config_ep_by_speed(cdev->gadget, f, acm->notify)) if (config_ep_by_speed(cdev->gadget, f, acm->notify))
return -EINVAL; return -EINVAL;
} }
...@@ -440,11 +444,13 @@ static int acm_set_alt(struct usb_function *f, unsigned intf, unsigned alt) ...@@ -440,11 +444,13 @@ static int acm_set_alt(struct usb_function *f, unsigned intf, unsigned alt)
} else if (intf == acm->data_id) { } else if (intf == acm->data_id) {
if (acm->port.in->driver_data) { if (acm->port.in->driver_data) {
DBG(cdev, "reset acm ttyGS%d\n", acm->port_num); dev_dbg(&cdev->gadget->dev,
"reset acm ttyGS%d\n", acm->port_num);
gserial_disconnect(&acm->port); gserial_disconnect(&acm->port);
} }
if (!acm->port.in->desc || !acm->port.out->desc) { if (!acm->port.in->desc || !acm->port.out->desc) {
DBG(cdev, "activate acm ttyGS%d\n", acm->port_num); dev_dbg(&cdev->gadget->dev,
"activate acm ttyGS%d\n", acm->port_num);
if (config_ep_by_speed(cdev->gadget, f, if (config_ep_by_speed(cdev->gadget, f,
acm->port.in) || acm->port.in) ||
config_ep_by_speed(cdev->gadget, f, config_ep_by_speed(cdev->gadget, f,
...@@ -467,7 +473,7 @@ static void acm_disable(struct usb_function *f) ...@@ -467,7 +473,7 @@ static void acm_disable(struct usb_function *f)
struct f_acm *acm = func_to_acm(f); struct f_acm *acm = func_to_acm(f);
struct usb_composite_dev *cdev = f->config->cdev; struct usb_composite_dev *cdev = f->config->cdev;
DBG(cdev, "acm ttyGS%d deactivated\n", acm->port_num); dev_dbg(&cdev->gadget->dev, "acm ttyGS%d deactivated\n", acm->port_num);
gserial_disconnect(&acm->port); gserial_disconnect(&acm->port);
usb_ep_disable(acm->notify); usb_ep_disable(acm->notify);
acm->notify->driver_data = NULL; acm->notify->driver_data = NULL;
...@@ -537,7 +543,7 @@ static int acm_notify_serial_state(struct f_acm *acm) ...@@ -537,7 +543,7 @@ static int acm_notify_serial_state(struct f_acm *acm)
spin_lock(&acm->lock); spin_lock(&acm->lock);
if (acm->notify_req) { if (acm->notify_req) {
DBG(cdev, "acm ttyGS%d serial state %04x\n", dev_dbg(&cdev->gadget->dev, "acm ttyGS%d serial state %04x\n",
acm->port_num, acm->serial_state); acm->port_num, acm->serial_state);
status = acm_cdc_notify(acm, USB_CDC_NOTIFY_SERIAL_STATE, status = acm_cdc_notify(acm, USB_CDC_NOTIFY_SERIAL_STATE,
0, &acm->serial_state, sizeof(acm->serial_state)); 0, &acm->serial_state, sizeof(acm->serial_state));
...@@ -691,7 +697,8 @@ acm_bind(struct usb_configuration *c, struct usb_function *f) ...@@ -691,7 +697,8 @@ acm_bind(struct usb_configuration *c, struct usb_function *f)
if (status) if (status)
goto fail; goto fail;
DBG(cdev, "acm ttyGS%d: %s speed IN/%s OUT/%s NOTIFY/%s\n", dev_dbg(&cdev->gadget->dev,
"acm ttyGS%d: %s speed IN/%s OUT/%s NOTIFY/%s\n",
acm->port_num, acm->port_num,
gadget_is_superspeed(c->cdev->gadget) ? "super" : gadget_is_superspeed(c->cdev->gadget) ? "super" :
gadget_is_dualspeed(c->cdev->gadget) ? "dual" : "full", gadget_is_dualspeed(c->cdev->gadget) ? "dual" : "full",
......
...@@ -200,19 +200,22 @@ static int obex_set_alt(struct usb_function *f, unsigned intf, unsigned alt) ...@@ -200,19 +200,22 @@ static int obex_set_alt(struct usb_function *f, unsigned intf, unsigned alt)
if (alt != 0) if (alt != 0)
goto fail; goto fail;
/* NOP */ /* NOP */
DBG(cdev, "reset obex ttyGS%d control\n", obex->port_num); dev_dbg(&cdev->gadget->dev,
"reset obex ttyGS%d control\n", obex->port_num);
} else if (intf == obex->data_id) { } else if (intf == obex->data_id) {
if (alt > 1) if (alt > 1)
goto fail; goto fail;
if (obex->port.in->driver_data) { if (obex->port.in->driver_data) {
DBG(cdev, "reset obex ttyGS%d\n", obex->port_num); dev_dbg(&cdev->gadget->dev,
"reset obex ttyGS%d\n", obex->port_num);
gserial_disconnect(&obex->port); gserial_disconnect(&obex->port);
} }
if (!obex->port.in->desc || !obex->port.out->desc) { if (!obex->port.in->desc || !obex->port.out->desc) {
DBG(cdev, "init obex ttyGS%d\n", obex->port_num); dev_dbg(&cdev->gadget->dev,
"init obex ttyGS%d\n", obex->port_num);
if (config_ep_by_speed(cdev->gadget, f, if (config_ep_by_speed(cdev->gadget, f,
obex->port.in) || obex->port.in) ||
config_ep_by_speed(cdev->gadget, f, config_ep_by_speed(cdev->gadget, f,
...@@ -224,7 +227,8 @@ static int obex_set_alt(struct usb_function *f, unsigned intf, unsigned alt) ...@@ -224,7 +227,8 @@ static int obex_set_alt(struct usb_function *f, unsigned intf, unsigned alt)
} }
if (alt == 1) { if (alt == 1) {
DBG(cdev, "activate obex ttyGS%d\n", obex->port_num); dev_dbg(&cdev->gadget->dev,
"activate obex ttyGS%d\n", obex->port_num);
gserial_connect(&obex->port, obex->port_num); gserial_connect(&obex->port, obex->port_num);
} }
...@@ -252,7 +256,7 @@ static void obex_disable(struct usb_function *f) ...@@ -252,7 +256,7 @@ static void obex_disable(struct usb_function *f)
struct f_obex *obex = func_to_obex(f); struct f_obex *obex = func_to_obex(f);
struct usb_composite_dev *cdev = f->config->cdev; struct usb_composite_dev *cdev = f->config->cdev;
DBG(cdev, "obex ttyGS%d disable\n", obex->port_num); dev_dbg(&cdev->gadget->dev, "obex ttyGS%d disable\n", obex->port_num);
gserial_disconnect(&obex->port); gserial_disconnect(&obex->port);
} }
...@@ -269,7 +273,8 @@ static void obex_connect(struct gserial *g) ...@@ -269,7 +273,8 @@ static void obex_connect(struct gserial *g)
status = usb_function_activate(&g->func); status = usb_function_activate(&g->func);
if (status) if (status)
DBG(cdev, "obex ttyGS%d function activate --> %d\n", dev_dbg(&cdev->gadget->dev,
"obex ttyGS%d function activate --> %d\n",
obex->port_num, status); obex->port_num, status);
} }
...@@ -284,7 +289,8 @@ static void obex_disconnect(struct gserial *g) ...@@ -284,7 +289,8 @@ static void obex_disconnect(struct gserial *g)
status = usb_function_deactivate(&g->func); status = usb_function_deactivate(&g->func);
if (status) if (status)
DBG(cdev, "obex ttyGS%d function deactivate --> %d\n", dev_dbg(&cdev->gadget->dev,
"obex ttyGS%d function deactivate --> %d\n",
obex->port_num, status); obex->port_num, status);
} }
...@@ -383,7 +389,7 @@ static int obex_bind(struct usb_configuration *c, struct usb_function *f) ...@@ -383,7 +389,7 @@ static int obex_bind(struct usb_configuration *c, struct usb_function *f)
obex->can_activate = true; obex->can_activate = true;
DBG(cdev, "obex ttyGS%d: %s speed IN/%s OUT/%s\n", dev_dbg(&cdev->gadget->dev, "obex ttyGS%d: %s speed IN/%s OUT/%s\n",
obex->port_num, obex->port_num,
gadget_is_dualspeed(c->cdev->gadget) ? "dual" : "full", gadget_is_dualspeed(c->cdev->gadget) ? "dual" : "full",
obex->port.in->name, obex->port.out->name); obex->port.in->name, obex->port.out->name);
......
...@@ -155,11 +155,13 @@ static int gser_set_alt(struct usb_function *f, unsigned intf, unsigned alt) ...@@ -155,11 +155,13 @@ static int gser_set_alt(struct usb_function *f, unsigned intf, unsigned alt)
/* we know alt == 0, so this is an activation or a reset */ /* we know alt == 0, so this is an activation or a reset */
if (gser->port.in->driver_data) { if (gser->port.in->driver_data) {
DBG(cdev, "reset generic ttyGS%d\n", gser->port_num); dev_dbg(&cdev->gadget->dev,
"reset generic ttyGS%d\n", gser->port_num);
gserial_disconnect(&gser->port); gserial_disconnect(&gser->port);
} }
if (!gser->port.in->desc || !gser->port.out->desc) { if (!gser->port.in->desc || !gser->port.out->desc) {
DBG(cdev, "activate generic ttyGS%d\n", gser->port_num); dev_dbg(&cdev->gadget->dev,
"activate generic ttyGS%d\n", gser->port_num);
if (config_ep_by_speed(cdev->gadget, f, gser->port.in) || if (config_ep_by_speed(cdev->gadget, f, gser->port.in) ||
config_ep_by_speed(cdev->gadget, f, gser->port.out)) { config_ep_by_speed(cdev->gadget, f, gser->port.out)) {
gser->port.in->desc = NULL; gser->port.in->desc = NULL;
...@@ -176,7 +178,8 @@ static void gser_disable(struct usb_function *f) ...@@ -176,7 +178,8 @@ static void gser_disable(struct usb_function *f)
struct f_gser *gser = func_to_gser(f); struct f_gser *gser = func_to_gser(f);
struct usb_composite_dev *cdev = f->config->cdev; struct usb_composite_dev *cdev = f->config->cdev;
DBG(cdev, "generic ttyGS%d deactivated\n", gser->port_num); dev_dbg(&cdev->gadget->dev,
"generic ttyGS%d deactivated\n", gser->port_num);
gserial_disconnect(&gser->port); gserial_disconnect(&gser->port);
} }
...@@ -239,7 +242,7 @@ static int gser_bind(struct usb_configuration *c, struct usb_function *f) ...@@ -239,7 +242,7 @@ static int gser_bind(struct usb_configuration *c, struct usb_function *f)
gser_ss_function); gser_ss_function);
if (status) if (status)
goto fail; goto fail;
DBG(cdev, "generic ttyGS%d: %s speed IN/%s OUT/%s\n", dev_dbg(&cdev->gadget->dev, "generic ttyGS%d: %s speed IN/%s OUT/%s\n",
gser->port_num, gser->port_num,
gadget_is_superspeed(c->cdev->gadget) ? "super" : gadget_is_superspeed(c->cdev->gadget) ? "super" :
gadget_is_dualspeed(c->cdev->gadget) ? "dual" : "full", gadget_is_dualspeed(c->cdev->gadget) ? "dual" : "full",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment