Date: Wed, 29 Feb 2012 01:32:10 +0000 (UTC) From: Damjan Marion <dmarion@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r232281 - projects/armv6/sys/dev/ofw Message-ID: <201202290132.q1T1WA25001172@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: dmarion Date: Wed Feb 29 01:32:09 2012 New Revision: 232281 URL: http://svn.freebsd.org/changeset/base/232281 Log: Fix byte order. Approved by: cognet (mentor) Modified: projects/armv6/sys/dev/ofw/ofw_iicbus.c Modified: projects/armv6/sys/dev/ofw/ofw_iicbus.c ============================================================================== --- projects/armv6/sys/dev/ofw/ofw_iicbus.c Wed Feb 29 01:04:37 2012 (r232280) +++ projects/armv6/sys/dev/ofw/ofw_iicbus.c Wed Feb 29 01:32:09 2012 (r232281) @@ -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.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201202290132.q1T1WA25001172>