aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/dwc2
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2013-11-25 17:11:29 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-11-25 12:01:49 -0800
commitd31e6ca405d448dd8d1ed6a4a13c42971fd6c853 (patch)
tree6a22d6c132ce56d02f35e017fb055251bf8f1ca9 /drivers/staging/dwc2
parentstaging: dwc2: remove #ifdef DEBUG from a couple of places (diff)
downloadlinux-dev-d31e6ca405d448dd8d1ed6a4a13c42971fd6c853.tar.xz
linux-dev-d31e6ca405d448dd8d1ed6a4a13c42971fd6c853.zip
staging: dwc2: cleanups in dwc2_hcd_qh_add()
I've made the success and error paths clearer and pulled some code in one indent level. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Paul Zimmerman <paulz@synopsys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/dwc2')
-rw-r--r--drivers/staging/dwc2/hcd_queue.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/staging/dwc2/hcd_queue.c b/drivers/staging/dwc2/hcd_queue.c
index 729cc0b83df3..e2855ed94e6e 100644
--- a/drivers/staging/dwc2/hcd_queue.c
+++ b/drivers/staging/dwc2/hcd_queue.c
@@ -579,7 +579,7 @@ static void dwc2_deschedule_periodic(struct dwc2_hsotg *hsotg,
*/
int dwc2_hcd_qh_add(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh)
{
- int status = 0;
+ int status;
u32 intr_mask;
if (dbg_qh(qh))
@@ -587,7 +587,7 @@ int dwc2_hcd_qh_add(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh)
if (!list_empty(&qh->qh_list_entry))
/* QH already in a schedule */
- return status;
+ return 0;
/* Add the new QH to the appropriate schedule */
if (dwc2_qh_is_non_per(qh)) {
@@ -596,17 +596,17 @@ int dwc2_hcd_qh_add(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh)
&hsotg->non_periodic_sched_inactive);
} else {
status = dwc2_schedule_periodic(hsotg, qh);
- if (status == 0) {
- if (!hsotg->periodic_qh_count) {
- intr_mask = readl(hsotg->regs + GINTMSK);
- intr_mask |= GINTSTS_SOF;
- writel(intr_mask, hsotg->regs + GINTMSK);
- }
- hsotg->periodic_qh_count++;
+ if (status)
+ return status;
+ if (!hsotg->periodic_qh_count) {
+ intr_mask = readl(hsotg->regs + GINTMSK);
+ intr_mask |= GINTSTS_SOF;
+ writel(intr_mask, hsotg->regs + GINTMSK);
}
+ hsotg->periodic_qh_count++;
}
- return status;
+ return 0;
}
/**