Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1417116

[PATCH v9 11/14] usb: otg: use dev_dbg() instead of VDBG()

From Roger Quadros <rogerq@ti.com>
Newsgroups linux.kernel
Subject [PATCH v9 11/14] usb: otg: use dev_dbg() instead of VDBG()
Date 2016-06-08 11:10 +0200
Message-ID <rHHES-6Fd-27@gated-at.bofh.it> (permalink)
References <rHHER-6Fd-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Now that we have a device reference in struct usb_otg
let's use dev_dbg() for debug messages.

Signed-off-by: Roger Quadros <rogerq@ti.com>
Acked-by: Peter Chen <peter.chen@nxp.com>
---
 drivers/usb/common/usb-otg-fsm.c | 19 +++++++------------
 1 file changed, 7 insertions(+), 12 deletions(-)

diff --git a/drivers/usb/common/usb-otg-fsm.c b/drivers/usb/common/usb-otg-fsm.c
index 482d4c9..e6e58c2 100644
--- a/drivers/usb/common/usb-otg-fsm.c
+++ b/drivers/usb/common/usb-otg-fsm.c
@@ -30,13 +30,6 @@
 #include <linux/usb/otg.h>
 #include <linux/usb/otg-fsm.h>
 
-#ifdef VERBOSE
-#define VDBG(fmt, args...) pr_debug("[%s]  " fmt, \
-				 __func__, ## args)
-#else
-#define VDBG(stuff...)	do {} while (0)
-#endif
-
 /* Change USB protocol when there is a protocol change */
 static int otg_set_protocol(struct otg_fsm *fsm, int protocol)
 {
@@ -44,8 +37,9 @@ static int otg_set_protocol(struct otg_fsm *fsm, int protocol)
 	int ret = 0;
 
 	if (fsm->protocol != protocol) {
-		VDBG("Changing role fsm->protocol= %d; new protocol= %d\n",
-			fsm->protocol, protocol);
+		dev_vdbg(otg->dev,
+			 "Changing role fsm->protocol= %d; new protocol= %d\n",
+			 fsm->protocol, protocol);
 		/* stop old protocol */
 		if (fsm->protocol == PROTO_HOST)
 			ret = otg_start_host(otg, 0);
@@ -226,7 +220,7 @@ static int otg_set_state(struct otg_fsm *fsm, enum usb_otg_state new_state)
 
 	if (otg->state == new_state)
 		return 0;
-	VDBG("Set state: %s\n", usb_otg_state_string(new_state));
+	dev_vdbg(otg->dev, "Set state: %s\n", usb_otg_state_string(new_state));
 	otg_leave_state(fsm, otg->state);
 	switch (new_state) {
 	case OTG_STATE_B_IDLE:
@@ -358,7 +352,7 @@ int otg_statemachine(struct usb_otg *otg)
 
 	switch (state) {
 	case OTG_STATE_UNDEFINED:
-		VDBG("fsm->id = %d\n", fsm->id);
+		dev_vdbg(otg->dev, "fsm->id = %d\n", fsm->id);
 		if (fsm->id)
 			otg_set_state(fsm, OTG_STATE_B_IDLE);
 		else
@@ -466,7 +460,8 @@ int otg_statemachine(struct usb_otg *otg)
 	}
 	mutex_unlock(&fsm->lock);
 
-	VDBG("quit statemachine, changed = %d\n", fsm->state_changed);
+	dev_vdbg(otg->dev, "quit statemachine, changed = %d\n",
+		 fsm->state_changed);
 	return fsm->state_changed;
 }
 EXPORT_SYMBOL_GPL(otg_statemachine);
-- 
2.7.4

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v9 00/14] USB OTG/dual-role framework Roger Quadros <rogerq@ti.com> - 2016-06-08 11:10 +0200
  [PATCH v9 10/14] usb: otg: add hcd companion support Roger Quadros <rogerq@ti.com> - 2016-06-08 11:10 +0200
  [PATCH v9 11/14] usb: otg: use dev_dbg() instead of VDBG() Roger Quadros <rogerq@ti.com> - 2016-06-08 11:10 +0200
    Re: [PATCH v9 11/14] usb: otg: use dev_dbg() instead of VDBG() Joe Perches <joe@perches.com> - 2016-06-08 17:20 +0200
      Re: [PATCH v9 11/14] usb: otg: use dev_dbg() instead of VDBG() Roger Quadros <rogerq@ti.com> - 2016-06-09 09:30 +0200
    [PATCH v10 11/14] usb: otg: use dev_dbg() instead of VDBG() Roger Quadros <rogerq@ti.com> - 2016-06-09 10:00 +0200
      Re: [PATCH v10 11/14] usb: otg: use dev_dbg() instead of VDBG() Joe Perches <joe@perches.com> - 2016-06-09 17:50 +0200
        Re: [PATCH v10 11/14] usb: otg: use dev_dbg() instead of VDBG() Roger Quadros <rogerq@ti.com> - 2016-06-10 09:10 +0200
  [PATCH v9 02/14] usb: otg-fsm: Prevent build warning "VDBG" redefined Roger Quadros <rogerq@ti.com> - 2016-06-08 11:10 +0200
  [PATCH v9 09/14] usb: of: add an API to get OTG device from USB controller node Roger Quadros <rogerq@ti.com> - 2016-06-08 11:10 +0200
  [PATCH v9 14/14] usb: host: xhci-plat: Add otg device to platform data Roger Quadros <rogerq@ti.com> - 2016-06-08 11:10 +0200
  [PATCH v9 08/14] usb: otg: add OTG/dual-role core Roger Quadros <rogerq@ti.com> - 2016-06-08 11:10 +0200
    Re: [PATCH v9 08/14] usb: otg: add OTG/dual-role core Peter Chen <hzpeterchen@gmail.com> - 2016-06-08 12:00 +0200
      Re: [PATCH v9 08/14] usb: otg: add OTG/dual-role core Roger Quadros <rogerq@ti.com> - 2016-06-08 12:20 +0200
        Re: [PATCH v9 08/14] usb: otg: add OTG/dual-role core Peter Chen <hzpeterchen@gmail.com> - 2016-06-08 14:50 +0200
          Re: [PATCH v9 08/14] usb: otg: add OTG/dual-role core Roger Quadros <rogerq@ti.com> - 2016-06-09 09:30 +0200
    [PATCH v10 08/14] usb: otg: add OTG/dual-role core Roger Quadros <rogerq@ti.com> - 2016-06-09 10:00 +0200
      Re: [PATCH v10 08/14] usb: otg: add OTG/dual-role core Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> - 2016-06-09 14:40 +0200
        Re: [PATCH v10 08/14] usb: otg: add OTG/dual-role core Roger Quadros <rogerq@ti.com> - 2016-06-10 09:10 +0200
        Re: [PATCH v10 08/14] usb: otg: add OTG/dual-role core Roger Quadros <rogerq@ti.com> - 2016-06-10 12:20 +0200
          Re: [PATCH v10 08/14] usb: otg: add OTG/dual-role core Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> - 2016-06-10 12:50 +0200
            Re: [PATCH v10 08/14] usb: otg: add OTG/dual-role core Roger Quadros <rogerq@ti.com> - 2016-06-10 13:00 +0200
              Re: [PATCH v10 08/14] usb: otg: add OTG/dual-role core Felipe Balbi <balbi@kernel.org> - 2016-06-10 13:10 +0200
  [PATCH v9 13/14] usb: gadget: udc: adapt to OTG core Roger Quadros <rogerq@ti.com> - 2016-06-08 11:10 +0200
    RE: [PATCH v9 13/14] usb: gadget: udc: adapt to OTG core Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> - 2016-06-09 12:50 +0200
      Re: [PATCH v9 13/14] usb: gadget: udc: adapt to OTG core Roger Quadros <rogerq@ti.com> - 2016-06-10 09:10 +0200
  [PATCH v9 07/14] usb: otg: get rid of CONFIG_USB_OTG_FSM in favour of CONFIG_USB_OTG Roger Quadros <rogerq@ti.com> - 2016-06-08 11:20 +0200
  [PATCH v9 01/14] usb: hcd: Initialize hcd->flags to 0 Roger Quadros <rogerq@ti.com> - 2016-06-08 11:20 +0200
  [PATCH v9 05/14] usb: otg-fsm: move host controller operations into usb_otg->hcd_ops Roger Quadros <rogerq@ti.com> - 2016-06-08 11:20 +0200
  [PATCH v9 06/14] usb: gadget.h: Add OTG to gadget interface Roger Quadros <rogerq@ti.com> - 2016-06-08 11:20 +0200
  Re: [PATCH v9 00/14] USB OTG/dual-role framework Peter Chen <hzpeterchen@gmail.com> - 2016-06-09 07:30 +0200
    Re: [PATCH v9 00/14] USB OTG/dual-role framework Roger Quadros <rogerq@ti.com> - 2016-06-09 09:40 +0200
      RE: [PATCH v9 00/14] USB OTG/dual-role framework Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> - 2016-06-09 12:20 +0200

csiph-web