Thread (1 message) 1 message, 1 author, 2015-02-18

Re: [PATCH 2/2] drivers/tty: pl011: read fifo size from OF if present

From: Mark Rutland <hidden>
Date: 2015-02-18 19:08:34
Also in: linux-arm-kernel

On Wed, Feb 18, 2015 at 06:53:13PM +0000, Jorge Ramirez-Ortiz wrote:
quoted hunk
Signed-off-by: Jorge Ramirez-Ortiz <redacted>
---
 drivers/tty/serial/amba-pl011.c | 6 ++++++
 1 file changed, 6 insertions(+)
diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c
index 02016fc..23fef63 100644
--- a/drivers/tty/serial/amba-pl011.c
+++ b/drivers/tty/serial/amba-pl011.c
@@ -84,6 +84,12 @@ struct vendor_data {
 
 static unsigned int get_fifosize_arm(struct amba_device *dev)
 {
+	const void *prop;
+
+	prop = of_get_property(dev->dev.of_node, "fifo-size", NULL);
+	if (prop)
+		return of_read_ulong(prop, 1);
Use of_property_read_u32.

You will need to sanity check the result, also.

What value do you need for your platform?

Mark.
+
 	return amba_rev(dev) < 3 ? 16 : 32;
 }
 
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help