summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/ofpart.c
diff options
context:
space:
mode:
authorLinus Torvalds2013-05-09 19:15:46 +0200
committerLinus Torvalds2013-05-09 19:15:46 +0200
commita637b0d45947df686979b85361ad5bfa9d19fdd3 (patch)
tree926207cdfbbde430d1e7b515f32fe1c740b15745 /drivers/mtd/ofpart.c
parentMerge tag 'firewire-updates' of git://git.kernel.org/pub/scm/linux/kernel/git... (diff)
parentmtd: omap2: Use module_platform_driver() (diff)
downloadkernel-qcow2-linux-a637b0d45947df686979b85361ad5bfa9d19fdd3.tar.gz
kernel-qcow2-linux-a637b0d45947df686979b85361ad5bfa9d19fdd3.tar.xz
kernel-qcow2-linux-a637b0d45947df686979b85361ad5bfa9d19fdd3.zip
Merge tag 'for-linus-20130509' of git://git.infradead.org/linux-mtd
Pull MTD update from David Woodhouse: - Lots of cleanups from Artem, including deletion of some obsolete drivers - Support partitions larger than 4GiB in device tree - Support for new SPI chips * tag 'for-linus-20130509' of git://git.infradead.org/linux-mtd: (83 commits) mtd: omap2: Use module_platform_driver() mtd: bf5xx_nand: Use module_platform_driver() mtd: denali_dt: Remove redundant use of of_match_ptr mtd: denali_dt: Change return value to fix smatch warning mtd: denali_dt: Use module_platform_driver() mtd: denali_dt: Fix incorrect error check mtd: nand: subpage write support for hardware based ECC schemes mtd: omap2: use msecs_to_jiffies() mtd: nand_ids: use size macros mtd: nand_ids: improve LEGACY_ID_NAND macro a bit mtd: add 4 Toshiba nand chips for the full-id case mtd: add the support to parse out the full-id nand type mtd: add new fields to nand_flash_dev{} mtd: sh_flctl: Use of_match_ptr() macro mtd: gpio: Use of_match_ptr() macro mtd: gpio: Use devm_kzalloc() mtd: davinci_nand: Use of_match_ptr() mtd: dataflash: Use of_match_ptr() macro mtd: remove h720x flash support mtd: onenand: remove OneNAND simulator ...
Diffstat (limited to 'drivers/mtd/ofpart.c')
-rw-r--r--drivers/mtd/ofpart.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/mtd/ofpart.c b/drivers/mtd/ofpart.c
index 30bd907a260a..553d6d6d5603 100644
--- a/drivers/mtd/ofpart.c
+++ b/drivers/mtd/ofpart.c
@@ -55,6 +55,7 @@ static int parse_ofpart_partitions(struct mtd_info *master,
while ((pp = of_get_next_child(node, pp))) {
const __be32 *reg;
int len;
+ int a_cells, s_cells;
reg = of_get_property(pp, "reg", &len);
if (!reg) {
@@ -62,8 +63,10 @@ static int parse_ofpart_partitions(struct mtd_info *master,
continue;
}
- (*pparts)[i].offset = be32_to_cpu(reg[0]);
- (*pparts)[i].size = be32_to_cpu(reg[1]);
+ a_cells = of_n_addr_cells(pp);
+ s_cells = of_n_size_cells(pp);
+ (*pparts)[i].offset = of_read_number(reg, a_cells);
+ (*pparts)[i].size = of_read_number(reg + a_cells, s_cells);
partname = of_get_property(pp, "label", &len);
if (!partname)