Index: uspace/drv/infrastructure/rootamdm37x/rootamdm37x.c
===================================================================
--- uspace/drv/infrastructure/rootamdm37x/rootamdm37x.c	(revision 57912af3b52b268a8aecaaa8e27cd79fcc7f73a7)
+++ uspace/drv/infrastructure/rootamdm37x/rootamdm37x.c	(revision e5e2d733644a28922ccdf2939328e7cbd0dcfbb4)
@@ -112,6 +112,10 @@
 }
 
-static int usb_clocks(amdm37x_t *device, bool on)
-{
+/** Set DPLL3,4,5 to autoidle
+ * @param device Register map.
+ */
+static void dpll_autoidle(amdm37x_t *device)
+{
+	assert(device);
 	/* Set DPLL3 to automatic */
 	pio_change_32(&device->cm.clocks->autoidle_pll,
@@ -128,12 +132,12 @@
 	    CLOCK_CONTROL_CM_AUTOIDLE2_PLL_AUTO_PERIPH2_DPLL_AUTOMATIC,
 	    CLOCK_CONTROL_CM_AUTOIDLE2_PLL_AUTO_PERIPH2_DPLL_MASK, 5);
-
-
-#ifdef DEBUG_CM
-	printf("DPLL5 could be on: %"PRIx32" %"PRIx32".\n",
-	    pio_read_32((ioport32_t*)&device->cm.clocks->idlest_ckgen),
-	    pio_read_32((ioport32_t*)&device->cm.clocks->idlest2_ckgen));
-#endif
-
+}
+
+/** Enable/disable function and interface clocks for USBTLL and USBHOST.
+ * @param device Register map.
+ * @param on True to swoitch clocks on.
+ */
+static void usb_clocks_enable(amdm37x_t *device, bool on)
+{
 	if (on) {
 		/* Enable interface and function clock for USB TLL */
@@ -168,6 +172,4 @@
 		    CORE_CM_FCLKEN3_EN_USBTLL_FLAG, 5);
 	}
-
-	return EOK;
 }
 
@@ -179,5 +181,4 @@
 static int usb_tll_init(amdm37x_t *device)
 {
-
 	/* Reset USB TLL */
 	pio_set_32(&device->tll->sysconfig, TLL_SYSCONFIG_SOFTRESET_FLAG, 5);
@@ -340,14 +341,15 @@
 	}
 
-	ret = usb_clocks(device, true);
-	if (ret != EOK) {
-		ddf_msg(LVL_FATAL, "Failed to enable USB HC clocks!.\n");
-		return ret;
-	}
-
+	/* Set dplls to automatic */
+	dpll_autoidle(device);
+
+	/* Enable function and interface clocks */
+	usb_clocks_enable(device, true);
+
+	/* Init TLL */
 	ret = usb_tll_init(device);
 	if (ret != EOK) {
 		ddf_msg(LVL_FATAL, "Failed to init USB TLL!.\n");
-		usb_clocks(device, false);
+		usb_clocks_enable(device, false);
 		return ret;
 	}
