Thread (3 messages) flat view 3 messages, 3 authors, 2008-01-30

Re: [PATCH v2] powerpc: configure USB clock for MPC8315E

From: Olof Johansson <hidden>
Date: 2008-01-30 17:27:51

Hi,

On Wed, Jan 30, 2008 at 11:08:57AM -0600, Kim Phillips wrote:
quoted hunk ↗ jump to hunk
diff --git a/arch/powerpc/platforms/83xx/usb.c b/arch/powerpc/platforms/83xx/usb.c
index 681230a..14c83f1 100644
--- a/arch/powerpc/platforms/83xx/usb.c
+++ b/arch/powerpc/platforms/83xx/usb.c
@@ -124,10 +124,14 @@ int mpc831x_usb_cfg(void)
 	}
 
 	/* Configure clock */
-	temp = in_be32(immap + MPC83XX_SCCR_OFFS);
-	temp &= ~MPC83XX_SCCR_USB_MASK;
-	temp |= MPC83XX_SCCR_USB_DRCM_11;  /* 1:3 */
-	out_be32(immap + MPC83XX_SCCR_OFFS, temp);
+	if (of_find_compatible_node(NULL, NULL, "fsl,mpc8315-usb2-dr"))
+		clrsetbits_be32(immap + MPC83XX_SCCR_OFFS,
+		                MPC8315_SCCR_USB_MASK,
+		                MPC8315_SCCR_USB_DRCM_11);
You need an of_node_put here.

Also, it's weird to check for the global presence of a compatible
device. You already have the device node pointer in the function, why
don't you just check to see if that device is compatible instead?


-Olof
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help