diff --git a/drivers/mtd/mtd_progmem.c b/drivers/mtd/mtd_progmem.c index 8fcda67aae..e3eca2ee5f 100644 --- a/drivers/mtd/mtd_progmem.c +++ b/drivers/mtd/mtd_progmem.c @@ -392,6 +392,12 @@ FAR struct mtd_dev_s *progmem_initialize(void) g_progmem.blkshift = blkshift; g_progmem.initialized = true; + +#ifdef CONFIG_MTD_REGISTRATION + /* Register the MTD with the procfs system if enabled */ + + mtd_register(&priv->mtd, "progmem"); +#endif } /* Return the implementation-specific state structure as the MTD device */ diff --git a/drivers/mtd/skeleton.c b/drivers/mtd/skeleton.c index f9acf80e1e..1ccc1d879b 100644 --- a/drivers/mtd/skeleton.c +++ b/drivers/mtd/skeleton.c @@ -321,8 +321,19 @@ static int skel_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg) FAR struct mtd_dev_s *skel_initialize(void) { + /* Allocate an instance of the private data structure -- OR, if there can + * only be a single instance of the driver, then use a shared, global + * device structure. + */ + /* Perform initialization as necessary */ +#ifdef CONFIG_MTD_REGISTRATION + /* Register the MTD with the procfs system if enabled */ + + mtd_register(&priv->mtd, "skeleton"); +#endif + /* Return the implementation-specific state structure as the MTD device */ return (FAR struct mtd_dev_s *)&g_skeldev;