diff options
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 | } |