diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-25 11:19:14 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-25 11:19:14 -0400 |
commit | 51f00a471ce8f359627dd99aeac322947a0e491b (patch) | |
tree | de3f0c26359d7846fc5d6d0fdd147e225d979add /drivers/serial | |
parent | a7f505c6b15fb35c0de8136e370d2927ce29452c (diff) | |
parent | 97ff46cb69da22037346670ae515217c658ace02 (diff) |
Merge branch 'next-devicetree' of git://git.secretlab.ca/git/linux-2.6
* 'next-devicetree' of git://git.secretlab.ca/git/linux-2.6:
mtd/m25p80: add support to parse the partitions by OF node
of/irq: of_irq.c needs to include linux/irq.h
of/mips: Cleanup some include directives/files.
of/mips: Add device tree support to MIPS
of/flattree: Eliminate need to provide early_init_dt_scan_chosen_arch
of/device: Rework to use common platform_device_alloc() for allocating devices
of/xsysace: Fix OF probing on little-endian systems
of: use __be32 types for big-endian device tree data
of/irq: remove references to NO_IRQ in drivers/of/platform.c
of/promtree: add package-to-path support to pdt
of/promtree: add of_pdt namespace to pdt code
of/promtree: no longer call prom_ functions directly; use an ops structure
of/promtree: make drivers/of/pdt.c no longer sparc-only
sparc: break out some PROM device-tree building code out into drivers/of
of/sparc: convert various prom_* functions to use phandle
sparc: stop exporting openprom.h header
powerpc, of_serial: Endianness issues setting up the serial ports
of: MTD: Fix OF probing on little-endian systems
of: GPIO: Fix OF probing on little-endian systems
Diffstat (limited to 'drivers/serial')
-rw-r--r-- | drivers/serial/of_serial.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/serial/of_serial.c b/drivers/serial/of_serial.c index 2af8fd113123..17849dcb9adc 100644 --- a/drivers/serial/of_serial.c +++ b/drivers/serial/of_serial.c | |||
@@ -31,8 +31,8 @@ static int __devinit of_platform_serial_setup(struct platform_device *ofdev, | |||
31 | { | 31 | { |
32 | struct resource resource; | 32 | struct resource resource; |
33 | struct device_node *np = ofdev->dev.of_node; | 33 | struct device_node *np = ofdev->dev.of_node; |
34 | const unsigned int *clk, *spd; | 34 | const __be32 *clk, *spd; |
35 | const u32 *prop; | 35 | const __be32 *prop; |
36 | int ret, prop_size; | 36 | int ret, prop_size; |
37 | 37 | ||
38 | memset(port, 0, sizeof *port); | 38 | memset(port, 0, sizeof *port); |
@@ -55,23 +55,23 @@ static int __devinit of_platform_serial_setup(struct platform_device *ofdev, | |||
55 | /* Check for shifted address mapping */ | 55 | /* Check for shifted address mapping */ |
56 | prop = of_get_property(np, "reg-offset", &prop_size); | 56 | prop = of_get_property(np, "reg-offset", &prop_size); |
57 | if (prop && (prop_size == sizeof(u32))) | 57 | if (prop && (prop_size == sizeof(u32))) |
58 | port->mapbase += *prop; | 58 | port->mapbase += be32_to_cpup(prop); |
59 | 59 | ||
60 | /* Check for registers offset within the devices address range */ | 60 | /* Check for registers offset within the devices address range */ |
61 | prop = of_get_property(np, "reg-shift", &prop_size); | 61 | prop = of_get_property(np, "reg-shift", &prop_size); |
62 | if (prop && (prop_size == sizeof(u32))) | 62 | if (prop && (prop_size == sizeof(u32))) |
63 | port->regshift = *prop; | 63 | port->regshift = be32_to_cpup(prop); |
64 | 64 | ||
65 | port->irq = irq_of_parse_and_map(np, 0); | 65 | port->irq = irq_of_parse_and_map(np, 0); |
66 | port->iotype = UPIO_MEM; | 66 | port->iotype = UPIO_MEM; |
67 | port->type = type; | 67 | port->type = type; |
68 | port->uartclk = *clk; | 68 | port->uartclk = be32_to_cpup(clk); |
69 | port->flags = UPF_SHARE_IRQ | UPF_BOOT_AUTOCONF | UPF_IOREMAP | 69 | port->flags = UPF_SHARE_IRQ | UPF_BOOT_AUTOCONF | UPF_IOREMAP |
70 | | UPF_FIXED_PORT | UPF_FIXED_TYPE; | 70 | | UPF_FIXED_PORT | UPF_FIXED_TYPE; |
71 | port->dev = &ofdev->dev; | 71 | port->dev = &ofdev->dev; |
72 | /* If current-speed was set, then try not to change it. */ | 72 | /* If current-speed was set, then try not to change it. */ |
73 | if (spd) | 73 | if (spd) |
74 | port->custom_divisor = *clk / (16 * (*spd)); | 74 | port->custom_divisor = be32_to_cpup(clk) / (16 * (be32_to_cpup(spd))); |
75 | 75 | ||
76 | return 0; | 76 | return 0; |
77 | } | 77 | } |