diff --git a/drivers/mtd/maps/physmap_of.c b/drivers/mtd/maps/physmap_of.c
index 2e6fb68..83d121e 100644
--- a/drivers/mtd/maps/physmap_of.c
+++ b/drivers/mtd/maps/physmap_of.c
@@ -267,13 +267,14 @@ static int __devinit of_flash_probe(struct platform_device *dev)
                info->list[i].mtd->dev.parent = &dev->dev;
        }

-       err = 0;
        if (info->list_size == 1) {
+               err = 0;
                info->cmtd = info->list[0].mtd;
        } else if (info->list_size > 1) {
                /*
                 * We detected multiple devices. Concatenate them together.
                 */
+               err = 0;
                info->cmtd = mtd_concat_create(mtd_list, info->list_size,
                                               dev_name(&dev->dev));
                if (info->cmtd == NULL)
