Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d31e6ca4 authored by Dan Carpenter's avatar Dan Carpenter Committed by Greg Kroah-Hartman
Browse files

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: default avatarDan Carpenter <dan.carpenter@oracle.com>
Acked-by: default avatarPaul Zimmerman <paulz@synopsys.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c20e1c6a
Loading
Loading
Loading
Loading
+10 −10
Original line number Diff line number Diff line
@@ -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,7 +596,8 @@ 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 (status)
			return status;
		if (!hsotg->periodic_qh_count) {
			intr_mask = readl(hsotg->regs + GINTMSK);
			intr_mask |= GINTSTS_SOF;
@@ -604,9 +605,8 @@ int dwc2_hcd_qh_add(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh)
		}
		hsotg->periodic_qh_count++;
	}
	}

	return status;
	return 0;
}

/**