summaryrefslogtreecommitdiff
path: root/drivers/mtd/nand/raw/omap_gpmc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd/nand/raw/omap_gpmc.c')
-rw-r--r--drivers/mtd/nand/raw/omap_gpmc.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/mtd/nand/raw/omap_gpmc.c b/drivers/mtd/nand/raw/omap_gpmc.c
index f499d8611f..8c0f3a4233 100644
--- a/drivers/mtd/nand/raw/omap_gpmc.c
+++ b/drivers/mtd/nand/raw/omap_gpmc.c
@@ -13,10 +13,11 @@
#include <linux/bch.h>
#include <linux/compiler.h>
#include <nand.h>
-#include <linux/mtd/omap_elm.h>
#include <soc.h>
#include <dm/uclass.h>
+#include "omap_elm.h"
+
#define BADBLOCK_MARKER_LENGTH 2
#define SECTOR_BYTES 512
#define ECCSIZE0_SHIFT 12
@@ -1267,6 +1268,15 @@ void board_nand_init(void)
struct udevice *dev;
int ret;
+#ifdef CONFIG_NAND_OMAP_ELM
+ ret = uclass_get_device_by_driver(UCLASS_MTD,
+ DM_GET_DRIVER(gpmc_elm), &dev);
+ if (ret && ret != -ENODEV) {
+ pr_err("%s: Failed to get ELM device: %d\n", __func__, ret);
+ return;
+ }
+#endif
+
ret = uclass_get_device_by_driver(UCLASS_MTD,
DM_GET_DRIVER(gpmc_nand), &dev);
if (ret && ret != -ENODEV)