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
This commit is contained in:
@@ -31,8 +31,8 @@ static int __devinit of_platform_serial_setup(struct platform_device *ofdev,
|
||||
{
|
||||
struct resource resource;
|
||||
struct device_node *np = ofdev->dev.of_node;
|
||||
const unsigned int *clk, *spd;
|
||||
const u32 *prop;
|
||||
const __be32 *clk, *spd;
|
||||
const __be32 *prop;
|
||||
int ret, prop_size;
|
||||
|
||||
memset(port, 0, sizeof *port);
|
||||
@@ -55,23 +55,23 @@ static int __devinit of_platform_serial_setup(struct platform_device *ofdev,
|
||||
/* Check for shifted address mapping */
|
||||
prop = of_get_property(np, "reg-offset", &prop_size);
|
||||
if (prop && (prop_size == sizeof(u32)))
|
||||
port->mapbase += *prop;
|
||||
port->mapbase += be32_to_cpup(prop);
|
||||
|
||||
/* Check for registers offset within the devices address range */
|
||||
prop = of_get_property(np, "reg-shift", &prop_size);
|
||||
if (prop && (prop_size == sizeof(u32)))
|
||||
port->regshift = *prop;
|
||||
port->regshift = be32_to_cpup(prop);
|
||||
|
||||
port->irq = irq_of_parse_and_map(np, 0);
|
||||
port->iotype = UPIO_MEM;
|
||||
port->type = type;
|
||||
port->uartclk = *clk;
|
||||
port->uartclk = be32_to_cpup(clk);
|
||||
port->flags = UPF_SHARE_IRQ | UPF_BOOT_AUTOCONF | UPF_IOREMAP
|
||||
| UPF_FIXED_PORT | UPF_FIXED_TYPE;
|
||||
port->dev = &ofdev->dev;
|
||||
/* If current-speed was set, then try not to change it. */
|
||||
if (spd)
|
||||
port->custom_divisor = *clk / (16 * (*spd));
|
||||
port->custom_divisor = be32_to_cpup(clk) / (16 * (be32_to_cpup(spd)));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user