From: John Crispin Date: Sat, 5 May 2012 13:41:42 +0000 (+0200) Subject: MTD: MIPS: lantiq: verify that the NOR interface is available on falcon soc X-Git-Tag: upstream/snapshot3+hdmi~7341^2^6~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fa09eded0e3764ddb8a97440f5b5c5e65e413b6a;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git MTD: MIPS: lantiq: verify that the NOR interface is available on falcon 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 Acked-by: Artem Bityutskiy 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 --- diff --git a/drivers/mtd/maps/lantiq-flash.c b/drivers/mtd/maps/lantiq-flash.c index aefa111..c03456f 100644 --- a/drivers/mtd/maps/lantiq-flash.c +++ b/drivers/mtd/maps/lantiq-flash.c @@ -19,6 +19,7 @@ #include #include #include +#include #include @@ -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);