diff options
author | Jeremy Kerr <jeremy.kerr@canonical.com> | 2010-01-30 11:45:26 +0300 |
---|---|---|
committer | Grant Likely <grant.likely@secretlab.ca> | 2010-02-09 18:34:10 +0300 |
commit | 337148812f97368a8ec4a69f1691e4c5ce3af494 (patch) | |
tree | 3fa2e5477c657cb2ebc40db9182d0989a5d60e13 /drivers/of/of_spi.c | |
parent | 2e89e685a8fd0e8334de967739d11e2e28c1a4dd (diff) | |
download | linux-337148812f97368a8ec4a69f1691e4c5ce3af494.tar.xz |
of: assume big-endian properties, adding conversions where necessary
Properties in the device tree are specified as big-endian. At present,
the only platforms to support device trees are also big-endian, so we've
been acessing the properties as raw values.
We'd like to add device tree support to little-endian platforms too, so
add endian conversion to the sites where we access property values in
the common of code.
Compiled on powerpc (ppc44x_defconfig & ppc64_defconfig) and arm (fdt
support only for now).
Signed-off-by: Jeremy Kerr <jeremy.kerr@canonical.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'drivers/of/of_spi.c')
-rw-r--r-- | drivers/of/of_spi.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/of/of_spi.c b/drivers/of/of_spi.c index bed0ed6dcdc1..f65f48b98448 100644 --- a/drivers/of/of_spi.c +++ b/drivers/of/of_spi.c @@ -23,7 +23,7 @@ void of_register_spi_devices(struct spi_master *master, struct device_node *np) { struct spi_device *spi; struct device_node *nc; - const u32 *prop; + const __be32 *prop; int rc; int len; @@ -54,7 +54,7 @@ void of_register_spi_devices(struct spi_master *master, struct device_node *np) spi_dev_put(spi); continue; } - spi->chip_select = *prop; + spi->chip_select = be32_to_cpup(prop); /* Mode (clock phase/polarity/etc.) */ if (of_find_property(nc, "spi-cpha", NULL)) @@ -72,7 +72,7 @@ void of_register_spi_devices(struct spi_master *master, struct device_node *np) spi_dev_put(spi); continue; } - spi->max_speed_hz = *prop; + spi->max_speed_hz = be32_to_cpup(prop); /* IRQ */ spi->irq = irq_of_parse_and_map(nc, 0); |