xiaoxiang781216 commented on code in PR #16642: URL: https://github.com/apache/nuttx/pull/16642#discussion_r2191389645
########## drivers/mtd/ftl.c: ########## @@ -914,5 +1010,5 @@ int ftl_initialize(int minor, FAR struct mtd_dev_s *mtd) /* Do the real work by ftl_initialize_by_path */ snprintf(path, DEV_NAME_MAX, "/dev/mtdblock%d", minor); - return ftl_initialize_by_path(path, mtd); + return ftl_initialize_by_path(path, mtd, O_RDWR); Review Comment: but the argument is always O_RDWR. I would suggest to replace ftl_initialize with mtddriver_register and let fs layer auto add bch/ftl wrapper in open for you. Actually after the replacement, we can rename ftl_initialize_by_path to ftl_initialize. this improvement also fix your concern that manual ftl_initialize can just make one time decision. -- 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