[RFC PATCH 14/41] staging: dwc2: simplify debug output in dwc_hc_init

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Before, the value of the hcchar register was shifted and masked and then
the debug output extracted the individual values out of the complete
hcchar register again. This commit makes the debug prints directly use
the original values instead.

Signed-off-by: Matthijs Kooijman <matthijs@xxxxxxxx>
---
 drivers/staging/dwc2/core.c | 29 ++++++++---------------------
 1 file changed, 8 insertions(+), 21 deletions(-)

diff --git a/drivers/staging/dwc2/core.c b/drivers/staging/dwc2/core.c
index e64eb95..4068dd5 100644
--- a/drivers/staging/dwc2/core.c
+++ b/drivers/staging/dwc2/core.c
@@ -881,24 +881,13 @@ void dwc2_hc_init(struct dwc2_hsotg *hsotg, struct dwc2_host_chan *chan)
 		dev_vdbg(hsotg->dev, "set HCCHAR(%d) to %08x\n", hc_num, hcchar);
 
 		dev_vdbg(hsotg->dev, "%s: Channel %d\n", __func__, hc_num);
-		dev_vdbg(hsotg->dev, "	 Dev Addr: %d\n",
-			 hcchar >> HCCHAR_DEVADDR_SHIFT &
-			 HCCHAR_DEVADDR_MASK >> HCCHAR_DEVADDR_SHIFT);
-		dev_vdbg(hsotg->dev, "	 Ep Num: %d\n",
-			 hcchar >> HCCHAR_EPNUM_SHIFT &
-			 HCCHAR_EPNUM_MASK >> HCCHAR_EPNUM_SHIFT);
-		dev_vdbg(hsotg->dev, "	 Is In: %d\n", !!(hcchar & HCCHAR_EPDIR));
-		dev_vdbg(hsotg->dev, "	 Is Low Speed: %d\n",
-			 !!(hcchar & HCCHAR_LSPDDEV));
-		dev_vdbg(hsotg->dev, "	 Ep Type: %d\n",
-			 hcchar >> HCCHAR_EPTYPE_SHIFT &
-			 HCCHAR_EPTYPE_MASK >> HCCHAR_EPTYPE_SHIFT);
-		dev_vdbg(hsotg->dev, "	 Max Pkt: %d\n",
-			 hcchar >> HCCHAR_MPS_SHIFT &
-			 HCCHAR_MPS_MASK >> HCCHAR_MPS_SHIFT);
-		dev_vdbg(hsotg->dev, "	 Multi Cnt: %d\n",
-			 hcchar >> HCCHAR_MULTICNT_SHIFT &
-			 HCCHAR_MULTICNT_MASK >> HCCHAR_MULTICNT_SHIFT);
+		dev_vdbg(hsotg->dev, "	 Dev Addr: %d\n", chan->dev_addr);
+		dev_vdbg(hsotg->dev, "	 Ep Num: %d\n", chan->ep_num);
+		dev_vdbg(hsotg->dev, "	 Is In: %d\n", chan->ep_is_in);
+		dev_vdbg(hsotg->dev, "	 Is Low Speed: %d\n", chan->speed == USB_SPEED_LOW);
+		dev_vdbg(hsotg->dev, "	 Ep Type: %d\n", chan->ep_type);
+		dev_vdbg(hsotg->dev, "	 Max Pkt: %d\n", chan->max_packet);
+		dev_vdbg(hsotg->dev, "	 Multi Cnt: %d\n", 0);
 	}
 
 	/* Program the HCSPLT register for SPLITs */
@@ -921,9 +910,7 @@ void dwc2_hc_init(struct dwc2_hsotg *hsotg, struct dwc2_host_chan *chan)
 			dev_vdbg(hsotg->dev, "	  hub addr %d\n", chan->hub_addr);
 			dev_vdbg(hsotg->dev, "	  hub port %d\n", chan->hub_port);
 			dev_vdbg(hsotg->dev, "	  is_in %d\n", chan->ep_is_in);
-			dev_vdbg(hsotg->dev, "	  Max Pkt %d\n",
-				 hcchar >> HCCHAR_MPS_SHIFT &
-				 HCCHAR_MPS_MASK >> HCCHAR_MPS_SHIFT);
+			dev_vdbg(hsotg->dev, "	  Max Pkt %d\n", chan->max_packet);
 			dev_vdbg(hsotg->dev, "	  xferlen %d\n", chan->xfer_len);
 		}
 	}
-- 
1.8.0

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux