Commit b9e26dfdad5a4f9cbdaacafac6998614cc9c41bc

Authored by Linus Torvalds

Merge git://git.infradead.org/mtd-2.6

* git://git.infradead.org/mtd-2.6:
  mtd: plat_ram: call mtd_device_register only if partition data exists
  mtd: pxa2xx-flash.c: It used to fall back to provided table.
  mtd: gpmi: add missing include 'module.h'
  mtd: ndfc: fix typo in structure dereference

Showing 4 changed files Side-by-side Diff

drivers/mtd/maps/plat-ram.c
... ... @@ -227,10 +227,14 @@
227 227 if (!err)
228 228 dev_info(&pdev->dev, "registered mtd device\n");
229 229  
230   - /* add the whole device. */
231   - err = mtd_device_register(info->mtd, NULL, 0);
232   - if (err)
233   - dev_err(&pdev->dev, "failed to register the entire device\n");
  230 + if (pdata->nr_partitions) {
  231 + /* add the whole device. */
  232 + err = mtd_device_register(info->mtd, NULL, 0);
  233 + if (err) {
  234 + dev_err(&pdev->dev,
  235 + "failed to register the entire device\n");
  236 + }
  237 + }
234 238  
235 239 return err;
236 240  
drivers/mtd/maps/pxa2xx-flash.c
... ... @@ -98,7 +98,7 @@
98 98 }
99 99 info->mtd->owner = THIS_MODULE;
100 100  
101   - mtd_device_parse_register(info->mtd, probes, 0, NULL, 0);
  101 + mtd_device_parse_register(info->mtd, probes, 0, flash->parts, flash->nr_parts);
102 102  
103 103 platform_set_drvdata(pdev, info);
104 104 return 0;
drivers/mtd/nand/gpmi-nand/gpmi-nand.c
... ... @@ -21,9 +21,9 @@
21 21 #include <linux/clk.h>
22 22 #include <linux/slab.h>
23 23 #include <linux/interrupt.h>
  24 +#include <linux/module.h>
24 25 #include <linux/mtd/gpmi-nand.h>
25 26 #include <linux/mtd/partitions.h>
26   -
27 27 #include "gpmi-nand.h"
28 28  
29 29 /* add our owner bbt descriptor */
drivers/mtd/nand/ndfc.c
... ... @@ -188,7 +188,7 @@
188 188 if (!flash_np)
189 189 return -ENODEV;
190 190  
191   - ppdata->of_node = flash_np;
  191 + ppdata.of_node = flash_np;
192 192 ndfc->mtd.name = kasprintf(GFP_KERNEL, "%s.%s",
193 193 dev_name(&ndfc->ofdev->dev), flash_np->name);
194 194 if (!ndfc->mtd.name) {