From: Stephen Warren Date: Sun, 8 Mar 2015 05:48:55 +0000 (-0700) Subject: usb: dwc2: simplify wait_for_chhltd X-Git-Tag: v2015.07-rc1~416 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=66ffc87586e04d09f259bbca74f05b156d4cc96f;p=u-boot usb: dwc2: simplify wait_for_chhltd toggle is never NULL. Simplify the code by removing handling of when it is NULL. Signed-off-by: Stephen Warren --- diff --git a/drivers/usb/host/dwc2.c b/drivers/usb/host/dwc2.c index e8a7e713c8..5a1c44a8fb 100644 --- a/drivers/usb/host/dwc2.c +++ b/drivers/usb/host/dwc2.c @@ -724,11 +724,9 @@ int wait_for_chhltd(uint32_t *sub, int *toggle) hctsiz = readl(&hc_regs->hctsiz); *sub = (hctsiz & DWC2_HCTSIZ_XFERSIZE_MASK) >> DWC2_HCTSIZ_XFERSIZE_OFFSET; - if (toggle) - *toggle = (hctsiz & DWC2_HCTSIZ_PID_MASK) >> - DWC2_HCTSIZ_PID_OFFSET; + *toggle = (hctsiz & DWC2_HCTSIZ_PID_MASK) >> DWC2_HCTSIZ_PID_OFFSET; - debug("%s: sub=%u toggle=%d\n", __func__, *sub, toggle ? *toggle : -1); + debug("%s: sub=%u toggle=%d\n", __func__, *sub, *toggle); return 0; }