summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorandrew <andrew@FreeBSD.org>2015-04-07 12:42:06 +0000
committerandrew <andrew@FreeBSD.org>2015-04-07 12:42:06 +0000
commit3e40c64fd3bdeaffa722c67203b20c0a673ef903 (patch)
treed02c676de5fbf518900f3d230e8b471ac998590b
parent979d5901547bd4ac25c4446ef4032a9b70adc999 (diff)
downloadFreeBSD-src-3e40c64fd3bdeaffa722c67203b20c0a673ef903.zip
FreeBSD-src-3e40c64fd3bdeaffa722c67203b20c0a673ef903.tar.gz
Fix uart_fdt_get_clock. It should have beed using the cell variable passed
in, not value on the stack.
-rw-r--r--sys/dev/uart/uart_bus_fdt.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/sys/dev/uart/uart_bus_fdt.c b/sys/dev/uart/uart_bus_fdt.c
index 121bebb..918c892 100644
--- a/sys/dev/uart/uart_bus_fdt.c
+++ b/sys/dev/uart/uart_bus_fdt.c
@@ -66,19 +66,16 @@ static driver_t uart_fdt_driver = {
int
uart_fdt_get_clock(phandle_t node, pcell_t *cell)
{
- pcell_t clock;
/* clock-frequency is a FreeBSD-only extention. */
- if ((OF_getencprop(node, "clock-frequency", &clock,
- sizeof(clock))) <= 0)
- clock = 0;
-
- if (clock == 0)
+ if ((OF_getencprop(node, "clock-frequency", cell,
+ sizeof(*cell))) <= 0) {
/* Try to retrieve parent 'bus-frequency' */
/* XXX this should go to simple-bus fixup or so */
- if ((OF_getencprop(OF_parent(node), "bus-frequency", &clock,
- sizeof(clock))) <= 0)
- clock = 0;
+ if ((OF_getencprop(OF_parent(node), "bus-frequency", cell,
+ sizeof(*cell))) <= 0)
+ *cell = 0;
+ }
return (0);
}
OpenPOWER on IntegriCloud