Fix uart_fdt_get_clock. It should have beed using the cell variable passed
in, not value on the stack.
This commit is contained in:
parent
80867e61d8
commit
7966cc995c
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=281200
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user