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/mtd | |
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/mtd')
-rw-r--r-- | drivers/mtd/devices/m25p80.c | 7 | ||||
-rw-r--r-- | drivers/mtd/maps/physmap_of.c | 2 | ||||
-rw-r--r-- | drivers/mtd/ofpart.c | 4 |
3 files changed, 10 insertions, 3 deletions
diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c index 6f512b5c117b..ea22520c0406 100644 --- a/drivers/mtd/devices/m25p80.c +++ b/drivers/mtd/devices/m25p80.c | |||
@@ -924,6 +924,13 @@ static int __devinit m25p_probe(struct spi_device *spi) | |||
924 | nr_parts = data->nr_parts; | 924 | nr_parts = data->nr_parts; |
925 | } | 925 | } |
926 | 926 | ||
927 | #ifdef CONFIG_OF | ||
928 | if (nr_parts <= 0 && spi->dev.of_node) { | ||
929 | nr_parts = of_mtd_parse_partitions(&spi->dev, | ||
930 | spi->dev.of_node, &parts); | ||
931 | } | ||
932 | #endif | ||
933 | |||
927 | if (nr_parts > 0) { | 934 | if (nr_parts > 0) { |
928 | for (i = 0; i < nr_parts; i++) { | 935 | for (i = 0; i < nr_parts; i++) { |
929 | DEBUG(MTD_DEBUG_LEVEL2, "partitions[%d] = " | 936 | DEBUG(MTD_DEBUG_LEVEL2, "partitions[%d] = " |
diff --git a/drivers/mtd/maps/physmap_of.c b/drivers/mtd/maps/physmap_of.c index fe63f6bd663c..ec3edf6e68b4 100644 --- a/drivers/mtd/maps/physmap_of.c +++ b/drivers/mtd/maps/physmap_of.c | |||
@@ -294,7 +294,7 @@ static int __devinit of_flash_probe(struct platform_device *dev, | |||
294 | info->list[i].map.name = dev_name(&dev->dev); | 294 | info->list[i].map.name = dev_name(&dev->dev); |
295 | info->list[i].map.phys = res.start; | 295 | info->list[i].map.phys = res.start; |
296 | info->list[i].map.size = res_size; | 296 | info->list[i].map.size = res_size; |
297 | info->list[i].map.bankwidth = *width; | 297 | info->list[i].map.bankwidth = be32_to_cpup(width); |
298 | 298 | ||
299 | err = -ENOMEM; | 299 | err = -ENOMEM; |
300 | info->list[i].map.virt = ioremap(info->list[i].map.phys, | 300 | info->list[i].map.virt = ioremap(info->list[i].map.phys, |
diff --git a/drivers/mtd/ofpart.c b/drivers/mtd/ofpart.c index 8bf7dc6d1ce6..7bd171eefd21 100644 --- a/drivers/mtd/ofpart.c +++ b/drivers/mtd/ofpart.c | |||
@@ -53,8 +53,8 @@ int __devinit of_mtd_parse_partitions(struct device *dev, | |||
53 | continue; | 53 | continue; |
54 | } | 54 | } |
55 | 55 | ||
56 | (*pparts)[i].offset = reg[0]; | 56 | (*pparts)[i].offset = be32_to_cpu(reg[0]); |
57 | (*pparts)[i].size = reg[1]; | 57 | (*pparts)[i].size = be32_to_cpu(reg[1]); |
58 | 58 | ||
59 | partname = of_get_property(pp, "label", &len); | 59 | partname = of_get_property(pp, "label", &len); |
60 | if (!partname) | 60 | if (!partname) |