summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgonzo <gonzo@FreeBSD.org>2012-08-15 03:33:57 +0000
committergonzo <gonzo@FreeBSD.org>2012-08-15 03:33:57 +0000
commit7dcf863fe4ae5e10c9c55e6c27387d8d389687d9 (patch)
treef70f17e3331e994e0ec981d8506a24834b64d158
parentb501ab9dc953c1526e2383baf8e4a5c4165d7c7e (diff)
downloadFreeBSD-src-7dcf863fe4ae5e10c9c55e6c27387d8d389687d9.zip
FreeBSD-src-7dcf863fe4ae5e10c9c55e6c27387d8d389687d9.tar.gz
Merging of projects/armv6, part 4
r232281: Fix byte order.
-rw-r--r--sys/dev/ofw/ofw_iicbus.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/dev/ofw/ofw_iicbus.c b/sys/dev/ofw/ofw_iicbus.c
index 63a0464..f6cafb1 100644
--- a/sys/dev/ofw/ofw_iicbus.c
+++ b/sys/dev/ofw/ofw_iicbus.c
@@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$");
#include <sys/module.h>
#include <sys/mutex.h>
+#include <dev/fdt/fdt_common.h>
#include <dev/iicbus/iicbus.h>
#include <dev/iicbus/iiconf.h>
#include <dev/ofw/ofw_bus.h>
@@ -101,6 +102,7 @@ ofw_iicbus_attach(device_t dev)
struct iicbus_softc *sc = IICBUS_SOFTC(dev);
struct ofw_iicbus_devinfo *dinfo;
phandle_t child;
+ pcell_t paddr;
device_t childdev;
uint32_t addr;
@@ -121,10 +123,11 @@ ofw_iicbus_attach(device_t dev)
* property, then try the reg property. It moves around
* on different systems.
*/
- if (OF_getprop(child, "i2c-address", &addr, sizeof(addr)) == -1)
- if (OF_getprop(child, "reg", &addr, sizeof(addr)) == -1)
+ if (OF_getprop(child, "i2c-address", &paddr, sizeof(paddr)) == -1)
+ if (OF_getprop(child, "reg", &paddr, sizeof(paddr)) == -1)
continue;
+ addr = fdt32_to_cpu(paddr);
/*
* Now set up the I2C and OFW bus layer devinfo and add it
* to the bus.
OpenPOWER on IntegriCloud