diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-12-21 03:39:37 +0100 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-12-21 03:39:37 +0100 |
commit | b9e26dfdad5a4f9cbdaacafac6998614cc9c41bc (patch) | |
tree | 320442f423d38ae2eeafe0764985c72af9adaed2 /drivers/mtd/maps/plat-ram.c | |
parent | Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb... (diff) | |
parent | mtd: plat_ram: call mtd_device_register only if partition data exists (diff) | |
download | linux-b9e26dfdad5a4f9cbdaacafac6998614cc9c41bc.tar.xz linux-b9e26dfdad5a4f9cbdaacafac6998614cc9c41bc.zip |
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
Diffstat (limited to 'drivers/mtd/maps/plat-ram.c')
-rw-r--r-- | drivers/mtd/maps/plat-ram.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/mtd/maps/plat-ram.c b/drivers/mtd/maps/plat-ram.c index 94f553489725..45876d0e5b8e 100644 --- a/drivers/mtd/maps/plat-ram.c +++ b/drivers/mtd/maps/plat-ram.c @@ -227,10 +227,14 @@ static int platram_probe(struct platform_device *pdev) if (!err) dev_info(&pdev->dev, "registered mtd device\n"); - /* add the whole device. */ - err = mtd_device_register(info->mtd, NULL, 0); - if (err) - dev_err(&pdev->dev, "failed to register the entire device\n"); + if (pdata->nr_partitions) { + /* add the whole device. */ + err = mtd_device_register(info->mtd, NULL, 0); + if (err) { + dev_err(&pdev->dev, + "failed to register the entire device\n"); + } + } return err; |