jingfei195887 commented on code in PR #16642:
URL: https://github.com/apache/nuttx/pull/16642#discussion_r2206136668


##########
boards/arm/stm32l4/stm32l476vg-disco/src/stm32_bringup.c:
##########
@@ -231,31 +228,19 @@ int stm32_bringup(void)
         }
 
 #else /* if  defined(HAVE_N25QXXX_CHARDEV) */
-      /* Use the FTL layer to wrap the MTD driver as a block driver */
-
-      ret = ftl_initialize(N25QXXX_MTD_MINOR, g_mtd_fs);
-      if (ret < 0)
-        {
-          _err("ERROR: Failed to initialize the FTL layer: %d\n", ret);
-          return ret;
-        }
-
-#if defined(CONFIG_BCH)
       /* Use the minor number to create device paths */
 
-      snprintf(blockdev, sizeof(blockdev), "/dev/mtdblock%d",
-               N25QXXX_MTD_MINOR);
-      snprintf(chardev, sizeof(chardev), "/dev/mtd%d", N25QXXX_MTD_MINOR);
+      snprintf(mtddev, sizeof(mtddev), "/dev/mtd%d", N25QXXX_MTD_MINOR);
 
-      /* Now create a character device on the block device */
+      /* Register the MTD driver */
 
-      ret = bchdev_register(blockdev, chardev, false);
+      ret = register_mtddriver(mtddev, g_mtd_fs, 0755, NULL);
       if (ret < 0)
         {
-          _err("ERROR: bchdev_register %s failed: %d\n", chardev, ret);
+          _err("ERROR: register_mtddriver %s failed: %d\n", mtddev, ret);
           return ret;
         }
-#endif /* defined(CONFIG_BCH) */
+

Review Comment:
   done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to