]> Pileus Git - ~andy/linux/blobdiff - drivers/mtd/maps/lantiq-flash.c
Merge branch 'rc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild
[~andy/linux] / drivers / mtd / maps / lantiq-flash.c
index aefa11121674973a4e84f93d76898c79736baa98..c03456f17004017ca0cb1f65513343cd8d470b7c 100644 (file)
@@ -19,6 +19,7 @@
 #include <linux/mtd/cfi.h>
 #include <linux/platform_device.h>
 #include <linux/mtd/physmap.h>
+#include <linux/of.h>
 
 #include <lantiq_soc.h>
 
@@ -116,6 +117,12 @@ ltq_mtd_probe(struct platform_device *pdev)
        struct cfi_private *cfi;
        int err;
 
+       if (of_machine_is_compatible("lantiq,falcon") &&
+                       (ltq_boot_select() != BS_FLASH)) {
+               dev_err(&pdev->dev, "invalid bootstrap options\n");
+               return -ENODEV;
+       }
+
        ltq_mtd = kzalloc(sizeof(struct ltq_mtd), GFP_KERNEL);
        platform_set_drvdata(pdev, ltq_mtd);