diff options
Diffstat (limited to 'drivers/mtd/nand/plat_nand.c')
-rw-r--r-- | drivers/mtd/nand/plat_nand.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/mtd/nand/plat_nand.c b/drivers/mtd/nand/plat_nand.c index 90e143e5ad3e..317aff428e42 100644 --- a/drivers/mtd/nand/plat_nand.c +++ b/drivers/mtd/nand/plat_nand.c | |||
@@ -37,6 +37,11 @@ static int __devinit plat_nand_probe(struct platform_device *pdev) | |||
37 | struct resource *res; | 37 | struct resource *res; |
38 | int err = 0; | 38 | int err = 0; |
39 | 39 | ||
40 | if (pdata->chip.nr_chips < 1) { | ||
41 | dev_err(&pdev->dev, "invalid number of chips specified\n"); | ||
42 | return -EINVAL; | ||
43 | } | ||
44 | |||
40 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 45 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
41 | if (!res) | 46 | if (!res) |
42 | return -ENXIO; | 47 | return -ENXIO; |