Skip to content

Commit

Permalink
MTD: MIPS: lantiq: verify that the NOR interface is available on falc…
Browse files Browse the repository at this point in the history
…on soc

When running on a FALC-ON SoC, we need to check the bootstrap options to see
if NOR is available.

Signed-off-by: John Crispin <blogic@openwrt.org>
Acked-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Cc: linux-mtd@lists.infradead.org
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/3815/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
  • Loading branch information
John Crispin authored and Ralf Baechle committed May 21, 2012
1 parent 02fa961 commit fa09ede
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions drivers/mtd/maps/lantiq-flash.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit fa09ede

Please sign in to comment.