atheros[ar2315-spiflash]: print detected flash size
[openwrt/svn-archive/archive.git] / target / linux / atheros / patches-3.10 / 140-redboot_boardconfig.patch
index 3925b677c3f13b9ca769a81141f4685ab6214aca..98dbf52611decbb1c1541cb7ec251c365874b28a 100644 (file)
        int nrparts = 0;
        struct fis_image_desc *buf;
        struct mtd_partition *parts;
-@@ -225,14 +228,14 @@ static int parse_redboot_partitions(stru
+@@ -225,14 +228,15 @@ static int parse_redboot_partitions(stru
                }
        }
  #endif
 -      parts = kzalloc(sizeof(*parts)*nrparts + nulllen + namelen, GFP_KERNEL);
-+      parts = kzalloc(sizeof(*parts) * (nrparts + 1) + nulllen + namelen + sizeof(BOARD_CONFIG_PART), GFP_KERNEL);
++      parts = kzalloc(sizeof(*parts) * (nrparts + 1) + nulllen + namelen +
++                      sizeof(BOARD_CONFIG_PART), GFP_KERNEL);
  
        if (!parts) {
                ret = -ENOMEM;
  #ifdef CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED
        if (nulllen > 0) {
                strcpy(nullname, nullstring);
-@@ -251,6 +254,8 @@ static int parse_redboot_partitions(stru
+@@ -251,6 +255,8 @@ static int parse_redboot_partitions(stru
        }
  #endif
        for ( ; i<nrparts; i++) {
-+              if(max_offset < buf[i].flash_base + buf[i].size)
++              if (max_offset < buf[i].flash_base + buf[i].size)
 +                      max_offset = buf[i].flash_base + buf[i].size;
                parts[i].size = fl->img->size;
                parts[i].offset = fl->img->flash_base;
                parts[i].name = names;
-@@ -284,6 +289,13 @@ static int parse_redboot_partitions(stru
+@@ -284,6 +290,13 @@ static int parse_redboot_partitions(stru
                fl = fl->next;
                kfree(tmp_fl);
        }