summaryrefslogtreecommitdiffstats
path: root/sys/arm/lpc
diff options
context:
space:
mode:
authorian <ian@FreeBSD.org>2017-03-01 18:53:05 +0000
committerian <ian@FreeBSD.org>2017-03-01 18:53:05 +0000
commitfc497a4640d662955a6d75b5e5ca52703fbb525a (patch)
treec223db4235159a5da2c9474c890e95bd63a789d7 /sys/arm/lpc
parentac087346a293ff11c3c3241b44626ca2c83756e5 (diff)
downloadFreeBSD-src-fc497a4640d662955a6d75b5e5ca52703fbb525a.zip
FreeBSD-src-fc497a4640d662955a6d75b5e5ca52703fbb525a.tar.gz
MFC r308640:
Use the correct OF_getencprop over OF_getprop + fdt32_to_cpu to read integer data from the device tree.
Diffstat (limited to 'sys/arm/lpc')
-rw-r--r--sys/arm/lpc/lpc_fb.c4
-rw-r--r--sys/arm/lpc/lpc_timer.c5
2 files changed, 2 insertions, 7 deletions
diff --git a/sys/arm/lpc/lpc_fb.c b/sys/arm/lpc/lpc_fb.c
index b2eab8b..e496915 100644
--- a/sys/arm/lpc/lpc_fb.c
+++ b/sys/arm/lpc/lpc_fb.c
@@ -52,7 +52,6 @@ __FBSDID("$FreeBSD$");
#include <machine/resource.h>
#include <machine/intr.h>
-#include <dev/fdt/fdt_common.h>
#include <dev/ofw/ofw_bus.h>
#include <dev/ofw/ofw_bus_subr.h>
@@ -280,10 +279,9 @@ lpc_fb_intr(void *arg)
static int
lpc_fb_fdt_read(phandle_t node, const char *name, uint32_t *ret)
{
- if (OF_getprop(node, name, ret, sizeof(uint32_t)) <= 0)
+ if (OF_getencprop(node, name, ret, sizeof(uint32_t)) <= 0)
return (ENOENT);
- *ret = fdt32_to_cpu(*ret);
return (0);
}
diff --git a/sys/arm/lpc/lpc_timer.c b/sys/arm/lpc/lpc_timer.c
index ded53fa..f745cf0 100644
--- a/sys/arm/lpc/lpc_timer.c
+++ b/sys/arm/lpc/lpc_timer.c
@@ -40,7 +40,6 @@ __FBSDID("$FreeBSD$");
#include <machine/cpu.h>
#include <machine/intr.h>
-#include <dev/fdt/fdt_common.h>
#include <dev/ofw/ofw_bus.h>
#include <dev/ofw/ofw_bus_subr.h>
@@ -158,7 +157,7 @@ lpc_timer_attach(device_t dev)
/* Get PERIPH_CLK encoded in parent bus 'bus-frequency' property */
node = ofw_bus_get_node(dev);
- if (OF_getprop(OF_parent(node), "bus-frequency", &freq,
+ if (OF_getencprop(OF_parent(node), "bus-frequency", &freq,
sizeof(pcell_t)) <= 0) {
bus_release_resources(dev, lpc_timer_spec, sc->lt_res);
bus_teardown_intr(dev, sc->lt_res[2], intrcookie);
@@ -166,8 +165,6 @@ lpc_timer_attach(device_t dev)
return (ENXIO);
}
- freq = fdt32_to_cpu(freq);
-
/* Set desired frequency in event timer and timecounter */
sc->lt_et.et_frequency = (uint64_t)freq;
lpc_timecounter.tc_frequency = (uint64_t)freq;
OpenPOWER on IntegriCloud